Here’s a sample dataset that we’ll use. There are a lot of blank cells, which we’ll fill with zero values.
Method 1 – Apply the Go to Special Command to Fill Blank Cells with 0 in Excel
Steps:
- Select the cells in the range.
- Choose the Find & Select option in the Editing Ribbon.
- Click on Go to Special.
- Check Blanks.
- Press Enter.
- All the blank cells will be selected.
- Type 0 (zero) in a blank cell.
- Press Ctrl + Enter to apply it to all the cells.
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.
- Click on Find & Select.
- Choose Replace.
- Keep the Find what box blank.
- Type 0 in the Replace with box.
- Click on Replace All.
- Click OK when the notification pops up and close the Find and Replace dialog box.
- Each blank cell is filled up with 0.
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.
- Press Alt + F11 to open the VBA Macro window.
- Click on Insert.
- Choose Module.
- 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
- Save the code and press F5 to run it.
- In the input box, type 0 (zero).
- Press Enter.
- You will get all the blank cells filled with 0.
Read More: How to Fill Blank Cells with Value Above in Excel VBA
Download the Practice Workbook
Related Articles
- How to Fill Blank Cells with Value Below in Excel
- How to Fill Blank Cells with Value Above in Excel
- How to Fill Blank Cells with Color in Excel
- How to Fill Blank Cells with Value from Left in Excel
<< Go Back to Fill Blank Cells | Excel Cells | Learn Excel
Get FREE Advanced Excel Exercises with Solutions!