PC Review


Reply
Thread Tools Rate Thread

Display Zero's (0) in blank cells

 
 
michael.holohan@synovate.com
Guest
Posts: n/a
 
      15th Mar 2007
I need to format an excel worksheet to show "Zero" in cells that are
blank.

I understand how to show them when you type in Zero (0) but cannot get
it to show Zero when the cell is blank.

Any ideas would be very helpfull

 
Reply With Quote
 
 
 
 
John Coleman
Guest
Posts: n/a
 
      15th Mar 2007
I don't think that there is any format setting that will do this for
you. It is possible to quickly convert blanks to cells without any
VBA:

1) select the range of cells that you are interested in
2) hit F5 or type CtrlG to get the GoTo window displayed
3) select special
4) select blanks - hit ok
5) type 0 then ctrl+enter

here is a vba sub to convert blank cells to zeros in a range of cells:

Sub Zero(R As Range)
Dim cl As Range
For Each cl In R.Cells
If IsEmpty(cl.Value) Then cl.Value = 0
Next cl
End Sub

Sub test()
Zero Range("A1:C5")
End Sub

you could probably link this with a change event if you want a cell to
display 0 when you hit it.

Hth

-John Coleman



On Mar 15, 12:57 pm, michael.holo...@synovate.com wrote:
> I need to format an excel worksheet to show "Zero" in cells that are
> blank.
>
> I understand how to show them when you type in Zero (0) but cannot get
> it to show Zero when the cell is blank.
>
> Any ideas would be very helpfull



 
Reply With Quote
 
John Coleman
Guest
Posts: n/a
 
      15th Mar 2007
I should point out that both of my suggestions *change* blanks to
zeros - which goes a bit deeper than changing how blanks are
displayed. In particular, many worksheet functions such as AVERAGE()
ignore blanks but treat zeros as values. It is possible to modify both
suggestions to have the *string* zero replacing blanks (with a change
in text alignment making them look like ordinary zeros) and this will
help (?) with some functions such as AVERAGE() but will still cause
some functions lkie COUNTBLANKS() to behave differently. The bottom
line is that it seems you can only display values, and a cell with a
value is no longer blank.

Hth

-John Coleman


On Mar 15, 5:21 pm, "John Coleman" <jcole...@franciscan.edu> wrote:
> I don't think that there is any format setting that will do this for
> you. It is possible to quickly convert blanks to cells without any
> VBA:
>
> 1) select the range of cells that you are interested in
> 2) hit F5 or type CtrlG to get the GoTo window displayed
> 3) select special
> 4) select blanks - hit ok
> 5) type 0 then ctrl+enter
>
> here is a vba sub to convert blank cells to zeros in a range of cells:
>
> Sub Zero(R As Range)
> Dim cl As Range
> For Each cl In R.Cells
> If IsEmpty(cl.Value) Then cl.Value = 0
> Next cl
> End Sub
>
> Sub test()
> Zero Range("A1:C5")
> End Sub
>
> you could probably link this with a change event if you want a cell to
> display 0 when you hit it.
>
> Hth
>
> -John Coleman
>
> On Mar 15, 12:57 pm, michael.holo...@synovate.com wrote:
>
>
>
> > I need to format an excel worksheet to show "Zero" in cells that are
> > blank.

>
> > I understand how to show them when you type in Zero (0) but cannot get
> > it to show Zero when the cell is blank.

>
> > Any ideas would be very helpfull- Hide quoted text -

>
> - Show quoted text -



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Linking sheets how do I display the zeros (0) as blank cells kat106 Microsoft Excel Worksheet Functions 1 30th Sep 2009 05:56 PM
Display error msg when cells left blank =?Utf-8?B?SmFz?= Microsoft Excel Programming 5 16th May 2007 07:50 PM
PivotTable (blank) cells won't display NULL! Abdul Malik Said Microsoft Excel Programming 3 24th Mar 2005 08:32 PM
line graph display 0 for blank cells Mark Microsoft Excel Charting 1 27th Jan 2004 11:48 PM
IF function help - display certain character in blank cells Melisa Microsoft Excel Misc 3 1st Oct 2003 11:42 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 02:18 AM.