+ Reply to Thread
Results 1 to 5 of 5

Turn zero-valued cells into blank cells while preserving link

  1. #1
    Registered User
    Join Date
    07-19-2013
    Location
    Madrid
    MS-Off Ver
    Excel 2007
    Posts
    3

    Turn zero-valued cells into blank cells while preserving link

    Hello everyone,

    this is my first post as a forum member, but I've been using the forum for a while and you've already solved a couple of issues for me. So first of all I wanted to THANK EVERYONE for what you've already done for me!

    --- SITUATION:

    1.) Data in Sheet1 is linked to Sheet2.

    --- PROBLEM:

    2.) In Sheet1 where cells are blank, they appear as 0s.

    --- WHAT I'M LOOKING FOR:

    3) Cells that appear as 0's need to be blank/empty (not only "look" blank, so no conditional formatting changing colors!) AND the links need to be preserved.

    --- WHAT I'VE TRIED SO FAR

    I've tried this, which turns zero-valued cells into blank cells BUT BREAKS the links.

    For Each cell In ActiveSheet.UsedRange
    If Not IsEmpty(cell) Then
    If cell.Value = 0 Then
    cell.Value = ""
    End If
    End If
    Next


    That doesn't work for me cause the links need to be preserved. Any suggestions????

    Thank you so much for your help!!! Talk soon.

  2. #2
    Registered User
    Join Date
    07-19-2013
    Location
    Birmingham, England
    MS-Off Ver
    Excel 2010
    Posts
    23

    Re: Turn zero-valued cells into blank cells while preserving link

    Hello,

    Could you please explain why you are performing this action using VBA rather than (for instance) using an IF statement in a spreadsheet formula to test for ISBLANK in which case you could return a double quote ("") to add a blank entry to the cell. As this would be within a formula then the link would still be maintained.

    Kind regards,
    Simon.

  3. #3
    Registered User
    Join Date
    07-19-2013
    Location
    Madrid
    MS-Off Ver
    Excel 2007
    Posts
    3

    Re: Turn zero-valued cells into blank cells while preserving link

    Hi Simon,

    Thank you, that works perfectly!! Why was I asking for VBA? Lack of knowledge... I looked for solutions offered in other forums and they were VBA-based, so I assumed this was the way to go to solve the issue.

    I'm using =IF(ISBLANK(linkedcell);"";linkedcell)

    This way zero-valued cells turn to zero and any other value is preserved.

    My mistake: I thought that, as the linked cells were displaying a Zero, they weren't actually blank. So that evaluating for ISBLANK and setting "value_if_true" as "" won't work.

    Thanks again for the "lecture", Simon
    Last edited by ockidocki; 07-22-2013 at 07:57 AM.

  4. #4
    Registered User
    Join Date
    07-19-2013
    Location
    Birmingham, England
    MS-Off Ver
    Excel 2010
    Posts
    23

    Re: Turn zero-valued cells into blank cells while preserving link

    Great - glad it worked. Don't forget to add the Linkedcell back in for the FALSE condition of the IF statement :

    =IF(ISBLANK(linkedcell);"";linkedcell)

    The reason this issue occurs is that if a formula points to a blank cell, then Excel will evaluate it to zero. However, the underlying linked cell remains blank (or empty) and so you can test specifically for this.

    Simon

  5. #5
    Registered User
    Join Date
    07-19-2013
    Location
    Madrid
    MS-Off Ver
    Excel 2007
    Posts
    3

    Re: Turn zero-valued cells into blank cells while preserving link

    Thanks for the explanation, Simon!!

    You're right, I soon realized that I had to add the linkedcell back for the FALSE condition, so I edited the post! This way everyone can see the formula and use it as needed.

    Regards,

    Andrés

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] Turn off conditional formatting on blank cells
    By OverKnight in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 01-10-2013, 05:06 PM
  2. Display a hyphen in cells that link to BLANK cells
    By NicB in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-15-2010, 04:34 PM
  3. Replies: 3
    Last Post: 11-03-2009, 03:06 PM
  4. counting valued cells
    By bobzroom in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 07-24-2008, 09:39 AM
  5. References to Blank Cells turn into Zeros
    By statusquo in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 12-12-2005, 10:50 PM

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1