+ Reply to Thread
Results 1 to 7 of 7

Change background color if value not found on another sheet

  1. #1
    Registered User
    Join Date
    12-21-2012
    Location
    Edmonton
    MS-Off Ver
    Excel 2003
    Posts
    4

    Change background color if value not found on another sheet

    I am very new to macros, and am using excel 2003.

    I am looking for a macro that will change the background color in a cell if the value is not found on "sheet 3".

    I am sure this is very simple, but being new to recording macros, not so easy.

    Thanks.

  2. #2
    Valued Forum Contributor
    Join Date
    05-21-2009
    Location
    Great Britain
    MS-Off Ver
    Excel 2003
    Posts
    550

    Re: Change background color if value not found on another sheet

    This procedure looks for Sheet1 cell A1 - change as required.
    Please Login or Register  to view this content.
    Post responsibly. Search for excelforum.com

  3. #3
    Registered User
    Join Date
    12-21-2012
    Location
    Edmonton
    MS-Off Ver
    Excel 2003
    Posts
    4

    Re: Change background color if value not found on another sheet

    Thank you for your quick response. It is not working how I need it to.
    I need it to look through a column of values. It is showing red even though the value is in that column.

    Sorry for being so unknowledgable.

  4. #4
    Registered User
    Join Date
    12-21-2012
    Location
    Edmonton
    MS-Off Ver
    Excel 2003
    Posts
    4

    Re: Change background color if value not found on another sheet

    Maybe this will help.

    I need to look up cells B10 B18 and B26 on Sheet 1. If they are not found on Sheet 3, I need them to turn red.

  5. #5
    Valued Forum Contributor
    Join Date
    05-21-2009
    Location
    Great Britain
    MS-Off Ver
    Excel 2003
    Posts
    550

    Re: Change background color if value not found on another sheet

    Quote Originally Posted by kyrieanna View Post
    I need it to look through a column of values.
    Which column on Sheet3? Also note that the code specifies sheet names "Sheet1" and "Sheet3", not "Sheet 1", "Sheet 3" with the space as you had, though it should have displayed an error if the sheet names don't exist.

    The following code looks in Sheet3 column A (the "A:A" in the code) for cells B10 B18 and B26 on Sheet1, and colours them red if not found, or no colour if found.
    Please Login or Register  to view this content.
    If it still doesn't work, record a macro with you manually finding one of the cells and post the VBA code generated. And say what value is in Sheet1 cell B10, B18, B26.

  6. #6
    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,946

    Re: Change background color if value not found on another sheet

    hi kyrieanna and welcome to the forum

    To best describe or illustrate your problem you would be better off attaching a dummy workbook. The workbook should contain the same structure and some dummy data of the same type as the type you have in your real workbook - so, if a cell contains numbers & letters in this format abc-123 then that should be reflected in the dummy workbook.

    To attach a file to your post,
    click advanced (next to quick post),
    scroll down until you see "manage file",
    click that and select "add files" (top right corner).
    click "select files" find your file, click "open" click "upload" click 'done" bottom right. click "submit reply"

    Once the upload is completed the file name will appear below the input boxes in this window.
    You can then close the window to return to the new post screen.
    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

  7. #7
    Registered User
    Join Date
    12-21-2012
    Location
    Edmonton
    MS-Off Ver
    Excel 2003
    Posts
    4

    Red face Re: Change background color if value not found on another sheet

    Ok, This is frustrating. I have been trying to attach the xls file that I will be using, but it will not let me.

    Basically, This is what I need...

    B10, B18 and B26 (And every other column using the same rows) is a field that the user puts a work order number into. This is the Time Entry sheet.
    The WIP sheet (in which the data changes daily) is where the currently used Work Order Numbers are.

    I need for this to happen...

    If someone puts a non active work order number in (in other words, its not found on the WIP sheet), then the cell that the data is entered into will turn red.

    The same data is not necessarily inputted into each cell.

    There are normally between 50 and 75 work orders that are current at any given time.

+ 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