Discussion Locked

Fill cells with zeros if blank.

0 helpful
6 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.
How can I tell Excel 2000 to fill with zeros if a cell is blank?

6 replies

by dklippert

You could just use a formula =0. Here's a quick macro that fills blank cells with zero.
Sub MakeZero()
Dim RowNum As Integer
For RowNum = 1 To 20
If Worksheets("Sheet1").Cells(RowNum, 3).Value = "" Then Worksheets("Sheet1").Cells(RowNum, 3).Value = 0
Next RowNum
End Sub
It can be a lot more elegant, but you get the idea.

by lo

Do Tools, Options, select the View tab, find Zero Values in Windows Options lower section, center column on my Excel 97), Clear the box. Any calculation of Zero displas as an empty box. I think this is global, all sheets in the workbook.

by lo

Oops, misread the question, that clears zero from a cell and makes it blank.

This discussion is closed to new replies.