ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   How do I get the blank cells in excell to fill in with 0? (https://www.excelbanter.com/excel-discussion-misc-queries/138695-how-do-i-get-blank-cells-excell-fill-0-a.html)

CrazyBOBO

How do I get the blank cells in excell to fill in with 0?
 
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.

Mike

How do I get the blank cells in excell to fill in with 0?
 
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

"CrazyBOBO" wrote:

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.


Dave Peterson

How do I get the blank cells in excell to fill in with 0?
 
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)



CrazyBOBO wrote:

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.


--

Dave Peterson

Lori

How do I get the blank cells in excell to fill in with 0?
 
Or maybe do an EditReplace with Replace: 0 (leave find box blank).

On 12 Apr, 09:22, CrazyBOBO
wrote:
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.





All times are GMT +1. The time now is 01:59 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com