Skip to main content
 

How to find and replace all blank cells with certain number or text in Excel?

Author: Siluvia Last Modified: 2024-09-27

For a range of cells which are populated with some blank cells, you may need to find these blank cells and replace them with certain content. In this article, we provide three methods for you.

Find and replace all blank cells with Find and Replace function
Find and replace all blank cells with VBA code
Easily fill all blank cells in a range with Kutools for Excel


Find and replace all blank cells with Find and Replace function

You can use the Find and Replace function to replace all blank cells with certain content in Excel. Please do as follows.

1. Select the range with blank cells you need to replace with certain content, then press Ctrl + H keys simultaneously to open the Find and Replace dialog box.

2. In the popping up Find and Replace dialog box, under the Replace tab, keep the Find what box blank, enter the certain text you want to replace the blank cells into the Replace with box, and finally click the Replace All button. See screenshot:

set options in the find and replace dilaog box

3. Click the OK button in the following dialog box.

a promt box popps out to remind how many cells are replaced

Then all blank cells in selected range are replaced with certain content.


Easily fill all blank cells with certain value in Excel:

Kutools for Excel's Fill Blank Cells utility helps you easily fill all blank cells in selected range with certain number or text in Excel as the below demo shown.
Download and try it now! (30-day free trail)

fill all blank cells with certain value by kutools


Find and replace all blank cells with VBA code

You can also apply the VBA method to replace all blank cells with certain content in a range. Please do as follows.

1. Press the Alt + F11 keys simultaneously to open the Microsoft Visual Basic for Application window.

2. In the Microsoft Visual Basic for Application window, click Insert > Module, and then copy and paste below VBA code into the Module window.

VBA code: Replace blank cells with certain content

Sub Replace_Blanks()
	Dim xStr As String
	Dim xRg As Range
	Dim xCell As Range
	Dim xAddress As String
	Dim xUpdate As Boolean
	On Error Resume Next
	xAddress = Application.ActiveWindow.RangeSelection.Address
	Set xRg  = Application.InputBox("Please select a range", "Kutools for Excel", xAddress, , , , , 8)
	Set xRg  = xRg.SpecialCells(xlBlanks)
	If (Err <> 0) Or (xRg Is Nothing) Then
		MsgBox "No blank cells found", , "Kutools for Excel"
		Exit Sub
		End If
		xStr = Application.InputBox("Replace blank cells with what?", "Kutools for Excel")
		xUpdate = Application.ScreenUpdating
		Application.ScreenUpdating = False
		For Each xCell In xRg
			xCell.Formula = xStr
		Next
		Application.ScreenUpdating = xUpdate
	End Sub

3. Press the F5 key to run the code. In the Kutools for Excel dialog box, select the range with blank cells you need to find and replace, and then click the OK button.

vba code to select the range with blank cells to find and replace

4. In another Kutools for Excel dialog box, enter the certain content into the textbox, and click the OK button. See screenshot:

vba code to enter the certain content into the textbox

Then all blank cells are replaced with certain text immediately as you specified above.

Note: If the selected range does not contain blank cells, you will get the following dialog box.

a prompt box will pop out if the selected range does not contain blank cells


Easily fill all blank cells in a range with Kutools for Excel

The Fill Blank Cells utility of Kutools for Excel helps you easily fill all blank cells with certain content. Please do as follows.

Kutools for Excel offers over 300 advanced features to streamline complex tasks, boosting creativity and efficiency. Enhanced with AI capabilities, Kutools automates tasks with precision, making data management effortless. Detailed information of Kutools for Excel...         Free trial...

1. Select the range with blank cells you need to fill with certain content, and then click Kutools > Insert > Fill Blank Cells.

 click Fill Blank Cells feature of kutools

2. In the Fill Blank Cells dialog box, check the Fixed value option in the Fill with section, and then enter the certain content into the Filled value box, finally click the OK button.

set a specific text in the dilaog box

Then all blank cells in selected range are filled with the content as below screenshot shown.

all blank cells are filled with the specific text

Note: With this utility, you can also fill blank cells based on values, and fill blanks with linear values.

  If you want to have a free trial (30-day) of this utility, please click to download it, and then go to apply the operation according above steps.

Best Office Productivity Tools

🤖 Kutools AI Aide: Revolutionize data analysis based on: Intelligent Execution   |  Generate Code  |  Create Custom Formulas  |  Analyze Data and Generate Charts  |  Invoke Kutools Functions…
Popular Features: Find, Highlight or Identify Duplicates   |  Delete Blank Rows   |  Combine Columns or Cells without Losing Data   |   Round without Formula ...
Super Lookup: Multiple Criteria VLookup    Multiple Value VLookup  |   VLookup Across Multiple Sheets   |   Fuzzy Lookup ....
Advanced Drop-down List: Quickly Create Drop Down List   |  Dependent Drop Down List   |  Multi-select Drop Down List ....
Column Manager: Add a Specific Number of Columns  |  Move Columns  |  Toggle Visibility Status of Hidden Columns  |  Compare Ranges & Columns ...
Featured Features: Grid Focus   |  Design View   |   Big Formula Bar    Workbook & Sheet Manager   |  Resource Library (Auto Text)   |  Date Picker   |  Combine Worksheets   |  Encrypt/Decrypt Cells    Send Emails by List   |  Super Filter   |   Special Filter (filter bold/italic/strikethrough...) ...
Top 15 Toolsets12 Text Tools (Add Text, Remove Characters, ...)   |   50+ Chart Types (Gantt Chart, ...)   |   40+ Practical Formulas (Calculate age based on birthday, ...)   |   19 Insertion Tools (Insert QR Code, Insert Picture from Path, ...)   |   12 Conversion Tools (Numbers to Words, Currency Conversion, ...)   |   7 Merge & Split Tools (Advanced Combine Rows, Split Cells, ...)   |   ... and more

Supercharge Your Excel Skills with Kutools for Excel, and Experience Efficiency Like Never Before. Kutools for Excel Offers Over 300 Advanced Features to Boost Productivity and Save Time.  Click Here to Get The Feature You Need The Most...


Office Tab Brings Tabbed interface to Office, and Make Your Work Much Easier

  • Enable tabbed editing and reading in Word, Excel, PowerPoint, Publisher, Access, Visio and Project.
  • Open and create multiple documents in new tabs of the same window, rather than in new windows.
  • Increases your productivity by 50%, and reduces hundreds of mouse clicks for you every day!