How do I get the blank cells in excell to fill in with 0?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have an excell sheet and I want blank cells to automatically fill in with a
"0". I have tried formating, but that dose't work. I have tried a formula,
that works, but if the cells are filled in the the formula is gone. If I save
this sheet and use it again then the "0" will be gone with a formula. This is
driving me crazy.
 
Hi,

Do you really want to fill all blank cells with a zero because it will take
a very long time to check and then fiill the 16.7 million cells on a 2003
worksheet. If you have lots of patience then the code below will do it but I
suspect you need to clarify.

Sub fillit()
For y = 1 To 65536
For x = 1 To 256
If Cells(y, x).Value = "" Then
Cells(y, x).Value = 0
End If
Next
Next
End Sub

Mike
 
If the cells are really empty, you can select the range that should be 0's
(include as many non-empty cells as you want)...

Then Edit|Goto|Special|check blanks
Notice that just the empty cells in that original selection are now selected
then type 0
and hit ctrl-enter to fill all the cells in the selection.

I'm not sure how a formula fits into this.

Maybe you want to change the formula so that it looks like this:

=if(SomeCellIsEmpty,0,YourFormulaHere)

=if(a1="",0,3+a1*5)
 
Back
Top