Sub replaceBlankWithZero() Dim rng As Range Selection.Value = Selection.Value For Each rng In Selection If rng = "" Or rng = " " Then rng.Value = "0" Else End If Next rng End Sub
VBA Macro code to Replace Blank Cells with Zeros
For data where you have blank cells, you can use the below code to add zeros in all those cells. It makes easier to use those cells in further calculations.