+ Reply to Thread
Results 1 to 3 of 3

How can I use conditional formating between two sheets in one work

  1. #1
    Samad
    Guest

    How can I use conditional formating between two sheets in one work

    If employee number 5263 found in sheet 2, show the raw in main data on sheet
    1 in red, for instance.

  2. #2
    Valued Forum Contributor Excelenator's Avatar
    Join Date
    07-25-2006
    Location
    Wantagh, NY
    Posts
    333
    Conditional formatting wont allow you to reference another worksheet, however, as a work around you could add a column and paste in the formula

    =NOT(ISERROR(VLOOKUP(A1,Sheet2!A1:A7,1,FALSE)))

    Where cell A1 contains the employee number and Sheet2!A1:A7 contains the employee numbers on the other sheet. This formula will return TRUE if the employee is on the other sheet and FALSE if it is not. You can then hide this column if you want and use the result in your conditional formatting by highlighting the range you want to conditionally format and for the first record say you put the formula above in column D you would select Formula and type in =$D1 and select the red font format.
    ---------------------------------------------------
    ONLY APPLIES TO VBA RESPONSES WHERE APPROPRIATE
    To insert code into the VBE (Visual Basic Editor)
    1. Copy the code.
    2. Open workbook to paste code into.
    3. Right click any worksheet tab, select View Code
    4. VBE (Visual Basic Editor) opens to that sheets object
    5. You may change to another sheets object or the This Workbook object by double clicking it in the Project window
    6. In the blank space below the word "General" paste the copied code.

  3. #3
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    2016
    Posts
    14,675
    You can reference another worksheet if you use a named range.

    For example, if your employee numbers are in sheet 2 column A then select that column and use Insert > Name > Define to name that range, something like "employees" (without the quotes)

    then in sheet 1 if your employee numbers are in column C, select that column and use CF with "formula is" option

    =MATCH(C1,employees,0)

    choose red format

    that's it

+ 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