+ Reply to Thread
Results 1 to 5 of 5

Highlight Cell if Reference is Blank but Display 0

  1. #1
    Forum Contributor
    Join Date
    10-27-2005
    Posts
    177

    Highlight Cell if Reference is Blank but Display 0

    Hi everyone. Would appreciate a little help with my problem.

    Please see attached.

    Data sheet
    - this contains data to use. The cells highlighted in blue are those that have to be filled out. The rest the user should not touch. Sometimes, it is the quantity that has to be filled out, other times it is the rate.

    Upload Sheet
    - This sheet directly references the data sheet, and if it detects a blank Qty or Rate, it will return a 0. We use this sheet to upload to our accounting system. It does not recognize blanks, so blanks have to be 0.


    Problem:
    For those cells in the Upload Sheet that references a blank in the Data sheet, I would like them to display a 0 but also be highlighted in RED. The result should look like the Upload Sheet Desired Result sheet. Is there a a way to do this in VBA, or better yet just a simple formula?

    Any assistance would be greatly appreciated. Thank you.
    Attached Files Attached Files

  2. #2
    Forum Contributor
    Join Date
    01-03-2013
    Location
    Aberdeen, Scotland
    MS-Off Ver
    Excel 2007
    Posts
    163

    Re: Highlight Cell if Reference is Blank but Display 0

    Did you try to fix the problem using conditional formatting?

  3. #3
    Registered User
    Join Date
    01-04-2014
    Location
    India
    MS-Off Ver
    Excel 2007
    Posts
    3

    Re: Highlight Cell if Reference is Blank but Display 0

    Click on the cell that you want to highlight in RED when it has value as '0'. Go to Conditional formatting and set the condition as "if cell value is equal to zero then fill the cell with background RED". I got the below code when I recorded the steps that I explained above.
    Please Login or Register  to view this content.
    Hope this helps.

    Regards,
    Kumarapush123
    OfficeTricks.com - Excel VBA Macro - Tips and Tricks

  4. #4
    Forum Contributor
    Join Date
    10-27-2005
    Posts
    177

    Re: Highlight Cell if Reference is Blank but Display 0

    I could do conditional formatting, but the problem is when the reference is a legitimate 0. Like if the QTY that was entered in the Data sheet really was a 0 (and not a blank), then the Upload Sheet shouldn't highlight in red. It should only highlight when the QTY is blank ... but still display as 0. Is that possible with conditional formatting?

  5. #5
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,936

    Re: Highlight Cell if Reference is Blank but Display 0

    1 of the reasons we ask for the version you are using, is to customise formulas for you. Earlier versions cannot use all the features of later versions. This will work in 2010, and later, but may not work in earlier verions...

    1. highlight the range you want to apply the conditional formatting to
    2. on the home tab, styles, select CF
    3. select new rule, select use formula
    4. enter =ISBLANK(Data!E2)
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

+ 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. Highlight cell, display and store text
    By msverven in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 03-19-2013, 08:53 AM
  2. Display data reference from another worksheet based on cell reference
    By Drew123 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 07-18-2011, 03:52 PM
  3. Replies: 4
    Last Post: 07-15-2008, 01:42 PM
  4. Re: Conditional display - IF cell is blank, display next used row!
    By Patti in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 03-28-2006, 05:35 PM
  5. how to get excel to display blank if reference cell blank
    By silent1(not) in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 12-02-2005, 10:55 AM

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