Blanks -> 0 code

  • Thread starter Thread starter LiAD
  • Start date Start date
L

LiAD

Hi

Could someone give me a code please to replace a blank cell with a zero (0)
please? inisde the cell there is a formula which returns the blank

Thanks
LiAD
 
Sub zeroo()
For Each cel In Selection
If cel.Value = "" Then
cel.Value = 0
End If
Next
End Sub
 
If you use Gary's method you will delete the function that is in the cell.
If you want that then his method will work fine.

There is another option you could use. I'm not sure which version you are
using, but in Excel 2007 click the Windows icon in the upper left hand corner
and select Excel Options. Click Advanced, and scroll down to Display Options
for this Worksheet: then make sure the checkbox that reads "Show a zero in
cells that have a zero value" is set to True. This will show a "0" in all
your functions that calculate to "".

You can do it in Excel 2003 also. I'm just not sure which menu tab its
under. Try Tools or View, Maybe Edit.


Hope this helps! If so, click "YES" below.
 
Back
Top