Fill Blank Cells with specific value (0 or null)

This post will teach you how to fill all blank cells with specific value, such as: 0 or any other values in excel. How to locate all blank cells and then fill in all the blanks with any specific value. The below will guide you to fill empty cells with different ways in excel 2016 or 2013. How to fill blank cells with VBA code in Excel.

Assuming that you have a list of date in your worksheet and contains hundreds of empty or blank cells, and you want to fill the blank cells with a specific value, such as: 0 or zero. There are different methods to achieve the result. You can do it by manually, but it is not a good idea and it will consume a lot of time. Also you can refer to the below quick ways.

Method 1: Using Go to Special Feature

To fill all blank cells with specific value, you need to select or locate all blank cell in your worksheet firstly, you can use the Go To special Function to solve this problem in Microsoft excel. Let’s do the following:

1# select the range of cells that you want to fill in blanks

fill blank cells with specific value1

2# on the HOME tab, click Find & Select command under Editing group, then select Go To Special… menu from the pop-up menu list. Or just press F5 or Ctrl+G to open the Go To dialog box, then click Special… button.

fill blank cells with specific value2

3# the Go To Special window will appear on the screen.

4# choose Blanks radio button from the Select section. Then click OK button.

fill blank cells with specific value3

5# you will see that all blank cells are highlighted in the selected range.

fill blank cells with specific value4

6# press F2 to enter one specific value, such as: 0 or null in the active cell

fill blank cells with specific value5

7# then press Ctrl + Enter shortcuts, and you will see that all empty cells will be filled with the value that you entered in the step 6.

fill blank cells with specific value6

Method 2: Using Find & Replace Feature

You can also use the Find & Replace feature to fill in blank cells in excel. Let’s refer to the following steps:

1# select the range of cells with blank cells

2# On the HOME tab, click on “Find & Select” command under Editting group.

3# the Find and Replace dialog box will appear on the screen.

4# switch to Replace tab in the dialog, then leave the Find what: box blank and enter 0 or any other value in Replace with: box.

fill blank cells with specific value7

5# click Replace All button. And click on the OK button again. You will find that all blank cells will be filled with the value you entered in the Replace with box.

fill blank cells with specific value8

Method 3: using Excel Macro to Fill Blank cells

If you want to fill in the blank cells quickly with VBA code, then you can do it following:

1# select the range of cells that contains blank cells

2# click on “Visual Basic” command under DEVELOPER Tab.

Get the position of the nth using excel vba1

3# then the “Visual Basic Editor” window will appear.

4# click “Insert” ->”Module” to create a new module

convert column number to letter3

4# paste the below VBA code into the code window. Then clicking “Save” button.

fill empty blank cell with value2

Sub FillEmptyBlankCellWithValue()
    InputValue = InputBox("Type a value that you want to fill blank cell:", "FillEmptyBlankCellWithValue")
    For Each cell In Selection
        If IsEmpty(cell) Then
            cell.Value = InputValue
        End If
    Next
End Sub

5# back to the current worksheet, then run the above excel macro. Click Run button.

fill blank cells with specific value10

6# Enter one value that you want to fill blank cells, such as: type “excelhow.net” text string.

fill empty blank cell with value1

7# Let’s see the last result:

fill blank cells with specific value12

So you can use the above three quick ways to fill blank cells with 0 or any other value in excel. Welcome any comments.

Delete Rows Based on Cell Value

This post will guide you how to use the Find & Replace feature to delete or remove all rows based on certain cell value in Microsoft Excel. Or how to delete all rows that contain certain value with VBA code in excel, such as, removing all rows if cell contains 0 or any other value.

Assuming that you have a worksheet and you want to delete rows based on cell vlaue if the value is equal to 0. In another word, if the cell value contain 0, then delete that row contain value 0. The first thing you need to do is that how to find rows that contain certain value in your worksheet. And how to solve this problem? You can use the Find & Replace command or VBA code to achieve the result.

Delete rows based on cell value with Find & Replace feature

To delete rows based on a certain cell value with Find & Replace feature, you can refer to the following steps:

1# Select the range of cells that you want to delete rows based on certain cell value.

delete rows based on cell value1

2# on the HOME tab, click Find & Replace command under Editing group. Or just press Ctrl +F shortcut to open the Find and Replace box.

delete rows based on cell value2

3# the Find and Replace dialog box will appear on the screen.

4# type the certain value in the Find what: text box, and then click Find All button

5# you will see that the searched result will appear in the Find and Replace window.

delete rows based on cell value3

6# select all found values in the Find and Replace window and you will see that all cells contain certain value will be highlighted in your selected range.

delete rows based on cell value4

7# right-click on the selected cells, and select Delete…menu from the drop-down menu list. Then choose Entire row radio button in the Delete dialog box. Click OK button.

delete rows based on cell value5

delete rows based on cell value6

delete rows based on cell value7

Or you can go to HOME tab, click Delete command. Then click Delete Sheet Rows.

So far, all rows contain the certain value are deleted in your selected range. And if you want to remove the columns base on the certain value, just select Entire column radio button in the step 7.

Delete Rows Based on cell value with Excel VBA Macro (VBA code)

If you want to delete rows that contain the certain value in your worksheet with excel VBA Marco, you can refer to the following steps:

1# click on “Visual Basic” command under DEVELOPER Tab.

Get the position of the nth using excel vba1

2# then the “Visual Basic Editor” window will appear.

3# click “Insert” ->”Module” to create a new module

convert column number to letter3

4# paste the below VBA code into the code window. Then clicking “Save” button.

remove rows based on values3

Sub RemoveRowsBasedValue()
    Dim Dr As Range
    Set Ip = Application.Selection
    Set Ip = Application.InputBox("Select one range that you want to remove rows:", "RemoveRowsBasedValue", Ip.Address, Type:=8)
    Ds = Application.InputBox("Please type a text string:", "RemoveRowsBasedValue", Type:=2)
    For Each R In Ip
        If R.Value = Ds Then
            If Dr Is Nothing Then
                Set Dr = R
            Else
               Set Dr = Application.Union(Dr, R)
            End If
        End If
    Next
    Dr.EntireRow.Delete
End Sub

5# back to the current worksheet, then run the above excel macro. Click Run button.

delete rows based on cell value9

6# select a range that you want to delete rows, click OK button. Then type a text string contained in the range of rows to delete.

remove rows based on values1

remove rows based on values2

delete rows based on cell value12