Error Checking in Excel
Thanks Thanks:  0
Likes Likes:  0
Results 1 to 6 of 6

Thread: If cell value is 0 - How can you make that cell blank?

  1. #1
    New Member
    Join Date
    Apr 2002
    Location
    Plano, Texas
    Posts
    29
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    I know this is an elementary question, but I am a very new developer with a very complex report to write. I am attempting to do this in a Macro and I am unsure of the code. I have referenced John Walkenbach's books, but I am still stumped.

    Any info will be greatly appreciated.

  2. #2
    New Member
    Join Date
    Apr 2002
    Location
    Plano, Texas
    Posts
    29
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    On 2002-04-05 14:11, Larry wrote:
    I know this is an elementary question, but I am a very new developer with a very complex report to write. I am attempting to do this in a Macro and I am unsure of the code. I have referenced John Walkenbach's books, but I am still stumped.

    Any info will be greatly appreciated.

  3. #3
    MrExcel MVP Al Chara's Avatar
    Join Date
    Feb 2002
    Location
    Newark, Delaware
    Posts
    1,701
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    Try the following:

    If ActiveCell.Value = 0 Then ActiveCell.Value = ""

    I think this is what you want.
    Best regards,
    Allan Chara
    http://www.mrspreadsheets.com

  4. #4
    Board Regular
    Join Date
    Mar 2002
    Location
    London, UK
    Posts
    167
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default


    you can hide all zero values by going into tools options and deselecting the "zero values" box. Or in VBA the equivilent is...


    ActiveWindow.DisplayZeros = False


    Or if you want to do it in vba for a single cell,

    if range("a1")=0 then range("a1")=""

    or...

    if cells(rowx,colx)=0 then cells(rowx,colx)=""

  5. #5
    New Member
    Join Date
    Apr 2002
    Location
    Kansas
    Posts
    5
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    Cells.Replace "0", Null


  6. #6
    New Member
    Join Date
    Apr 2002
    Location
    Plano, Texas
    Posts
    29
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    Wow!! That was fast.

    Thanks to all.

Some videos you may like

User Tag List

Like this thread? Share it with others

Like this thread? Share it with others

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •