+ Reply to Thread
Results 1 to 4 of 4

Macro To Replace Cell Link With If Statement To Hide Zeros

  1. #1
    Registered User
    Join Date
    03-28-2009
    Location
    USA
    MS-Off Ver
    Excel 2003
    Posts
    37

    Macro To Replace Cell Link With If Statement To Hide Zeros

    I'm working on a sheet that has links to another workbook with some cells that will be empty at times, thus a zero is displayed in the linked cell. I understand that I can keep that zero from being displayed by modifying the link with an IF statement as follows:
    Please Login or Register  to view this content.
    What I'd like to do is have a macro that will automatically look for cell links that do not have this IF statement wrapping them and add it. Any other alternative (using macro for find/replace with wildcards??, etc.).

    Any help will be greatly appreciated,

    CVinje

  2. #2
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: Macro To Replace Cell Link With If Statement To Hide Zeros

    Is 0 ever a valid value ?

    If not rather than double evaluating all the links I would advise using a Custom Format on the relevant sections so as to hide the 0's.

  3. #3
    Registered User
    Join Date
    03-28-2009
    Location
    USA
    MS-Off Ver
    Excel 2003
    Posts
    37

    Re: Macro To Replace Cell Link With If Statement To Hide Zeros

    Yes, on some columns in the sheet, the value of Zero is preferred; however, if there is no easy solution to this problem, I could resort to un-checking the show zero box under the options, but I'd like to avoid that if possible.

    **Edited to add: Or, instead of un-checking that box, implementing the custom format on the selected cells (0;-0;;@) as you stated. That may be a viable solution, and I will begin looking at that now.

    Thanks,

    CVinje
    Last edited by CVinje; 09-24-2009 at 06:53 AM.

  4. #4
    Registered User
    Join Date
    03-28-2009
    Location
    USA
    MS-Off Ver
    Excel 2003
    Posts
    37

    Re: Macro To Replace Cell Link With If Statement To Hide Zeros

    After reviewing the option to use Custom Format to not show the zero value in certain cells I've determined that if there is anyway possible to accomplish this without using the custom format, it would definitely be preferable. In some instances, the value of zero is desired to be displayed in these cells (if the value of zero is displayed in the cell(s) linked to).

    Thanks,

    CVinje

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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