+ Reply to Thread
Results 1 to 11 of 11

0 Appears for Linking Blank Cells

  1. #1
    Forum Contributor
    Join Date
    01-08-2008
    Posts
    137

    0 Appears for Linking Blank Cells

    I am linking several cells in Sheet1 to other sheets throughout the workbook. Sheets2-10 to be exact. The problem is when no data is in a given cell in Sheet1 a '0' shows up on the linked cell in Sheet2-10. The problem is 0 can be a correct response sometimes and if 0 is always to show up someone is going to misunderstand the task.

    I just want to stop blank entries from being linked over as 0. I have a ton of cells being linked and don't want to do conditional formatting on each individual cell. Is their any easy way to stop this?

  2. #2
    Forum Contributor VBA Noob's Avatar
    Join Date
    04-25-2006
    Location
    London, England
    MS-Off Ver
    xl03 & xl 07(Jan 09)
    Posts
    11,988
    Try and if statement

    e.g

    =IF(Sheet1!A1="","",Sheet1!A1)
    VBA Noob
    _________________________________________


    Credo Elvem ipsum etian vivere
    _________________________________________
    A message for cross posters

    Please remember to wrap code.

    Forum Rules

    Please add to your signature if you found this link helpful. Excel links !!!

  3. #3
    Forum Contributor
    Join Date
    01-08-2008
    Posts
    137

    Error Message

    I wanted the cell in Sheet2 (where data was linked not to say 0) so I used this code:

    =IF(Sheet1!$B$4="","",Sheet1!$B$4)

    However I got an error message that reads: You may NOT use references to other worksheets or workbooks for Conditional Formatting Criteria"

    What is this all about? Is my Excel not setup right or something?

  4. #4
    Forum Contributor VBA Noob's Avatar
    Join Date
    04-25-2006
    Location
    London, England
    MS-Off Ver
    xl03 & xl 07(Jan 09)
    Posts
    11,988
    Should work unless your using Conditional formatting??

    VBA Noob

  5. #5
    Forum Contributor
    Join Date
    01-08-2008
    Posts
    137

    Smile you are right

    I was mistakenly putting the formula into the conditional formatting.

    One last question. I was able to get rid of the 0s with your code. However, this wasn't a problem with another workbook I have. In that case, when nothing is entered into a cell, a dash mark appears '-' which is perfect! I can't seem to figure out for the life of me why 0s appear when I try to link data (and this results in having to add that one line of code in a lot of places!). Any idea?

    Thank you for all the help so far.

  6. #6
    Forum Contributor VBA Noob's Avatar
    Join Date
    04-25-2006
    Location
    London, England
    MS-Off Ver
    xl03 & xl 07(Jan 09)
    Posts
    11,988
    Sorry but I have no idea what your talking about.

    VBA Noob

  7. #7
    Forum Contributor
    Join Date
    01-08-2008
    Posts
    137

    let me try to rephrase this

    Last Workbook
    ==========
    1.) Data in Sheet1 was linked to Sheet2.
    2.) In Sheet1 where cells were blank, they appear as '-' in Sheet2.
    3.) No code was found to do this.

    Current Workbook
    =============
    1.) Data in Sheet1 is linked to Sheet2.
    2.) In Sheet1 where cells are blank, they appear as 0s.
    3.) However, I could change this with your code.


    Any clude how the heck this was done without code? Were the settings modified or something?

  8. #8
    Forum Contributor VBA Noob's Avatar
    Join Date
    04-25-2006
    Location
    London, England
    MS-Off Ver
    xl03 & xl 07(Jan 09)
    Posts
    11,988
    Can you attach the file

    VBA Noob

  9. #9
    Forum Contributor
    Join Date
    01-08-2008
    Posts
    137

    Here it is

    1.) Look at the highlighted cell on the Input worksheet. It has the value 1.22. If you go over to the Lebonitz worksheet you will see it is there 1.22.
    2.) However, if you delete 1.22 from the Input tab a "-" appears on the Lebonitz worksheet instead of "0". How was this done?
    Attached Files Attached Files

  10. #10
    Forum Contributor VBA Noob's Avatar
    Join Date
    04-25-2006
    Location
    London, England
    MS-Off Ver
    xl03 & xl 07(Jan 09)
    Posts
    11,988
    Change the custom format in sheet Lebonitz from

    (* #,##0_);_(* (#,##0);_(* "-"??_);_(@_)
    to general or currency

    VBA Noob

  11. #11
    Forum Contributor
    Join Date
    01-08-2008
    Posts
    137

    got it

    Thank you so much!

+ 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