How to Fill Blank Cells with 0 in Excel (3 Methods)

Here’s a sample dataset that we’ll use. There are a lot of blank cells, which we’ll fill with zero values.

Sample Data


Method 1 – Apply the Go to Special Command to Fill Blank Cells with 0 in Excel

Steps:

  • Select the cells in the range.

Ways to Fill Blank Cells with 0 in Excel

  • Choose the Find & Select option in the Editing Ribbon.
  • Click on Go to Special.

Ways to Fill Blank Cells with 0 in Excel

  • Check Blanks.
  • Press Enter.

Ways to Fill Blank Cells with 0 in Excel

  • All the blank cells will be selected.

Ways to Fill Blank Cells with 0 in Excel

  • Type 0 (zero) in a blank cell.

Ways to Fill Blank Cells with 0 in Excel

  • Press Ctrl + Enter to apply it to all the cells.

Ways to Fill Blank Cells with 0 in Excel

You can use a keyboard shortcut Ctrl + G to start Go to Special directly.

Read More: Fill Blank Cells with Dash in Excel


Method 2 – Use the Replace Command to Fill Blank Cells with 0 in Excel

Steps:

  • Select the dataset.

Ways to Fill Blank Cells with 0 in Excel

  • Click on Find & Select.
  • Choose Replace.

Ways to Fill Blank Cells with 0 in Excel

  • Keep the Find what box blank.
  • Type 0 in the Replace with box.
  • Click on Replace All.

Ways to Fill Blank Cells with 0 in Excel

  • Click OK when the notification pops up and close the Find and Replace dialog box.

Ways to Fill Blank Cells with 0 in Excel

  • Each blank cell is filled up with 0.

Ways to Fill Blank Cells with 0 in Excel

The keyboard shortcut for the Replace command is Ctrl + H.

Read More: How to Find and Replace Blank Cells in Excel


Method 3 – Run VBA Code to Fill Blank Cells with 0 in Excel

Steps:

  • Select the cells.

Ways to Fill Blank Cells with 0 in Excel

  • Press Alt + F11 to open the VBA Macro window.
  • Click on Insert.
  • Choose Module.

Sample Data

  • Paste the following VBA code into the Module.
Sub Fill_Blank_Cells_with_0_in_Excel()
'Declare the variables
Dim Selected_area As Range
Dim Enter_Zero As String
On Error Resume Next
'Apply an input box to enter the value zero (0)
Enter_Zero = InputBox("Type a value(O) that will fill blank cells", _
"Fill Empty Cells")
'Apply a For loop
For Each Selected_area In Selection
'Use an If statement to meet the condition
If IsEmpty(Selected_area) Then
Selected_area.Value = Enter_Zero
End If
Next
End Sub

Sample Data

  • Save the code and press F5 to run it.
  • In the input box, type 0 (zero).
  • Press Enter.

Sample Data

  • You will get all the blank cells filled with 0.

Sample Data

Read More: How to Fill Blank Cells with Value Above in Excel VBA


Download the Practice Workbook


Related Articles


<< Go Back to Fill Blank Cells | Excel Cells | Learn Excel

Get FREE Advanced Excel Exercises with Solutions!
Bhubon Costa
Bhubon Costa

Bhubon Costa, B.Sc. in Naval Architecture & Marine Engineering from Bangladesh University of Engineering & Technology, has worked with the ExcelDemy since 2021. Currently, he has been working as a reviewer. Notably, he has written over 90 articles and led several VBA content development teams. He has a great passion for the fields of data analytics and data science. His areas of expertise include Excel VBA, Power Query, Pivot Table, Power BI, MySQL, PostgreSQL, machine learning, and Python... Read Full Bio

We will be happy to hear your thoughts

Leave a reply

Advanced Excel Exercises with Solutions PDF

 

 

ExcelDemy
Logo