+ Reply to Thread
Results 1 to 8 of 8

Look up Ref on two sheets and highlight a row range.

  1. #1
    Registered User
    Join Date
    06-07-2011
    Location
    USA
    MS-Off Ver
    Excel 2011
    Posts
    6

    Look up Ref on two sheets and highlight a row range.

    I am looking for a way to find if a AlphaNumeric (like "21 02D") reference in column E on sheet 1 and compare if that Alphanumeric is also on a table on sheet 2.
    If there is a match then highlight that row on sheet 1 from A:N.
    And then continue to the next number in column E and repeat.

    Any help is greatly appreciated.

    Thank you,
    TXJM

  2. #2
    Forum Expert etaf's Avatar
    Join Date
    10-22-2004
    Location
    Wittering, West Sussex, UK
    MS-Off Ver
    365 (Mac OSX) (16.83 (24031120))
    Posts
    8,745

    Re: Look up Ref on two sheets and highlight a row range.

    column E on sheet 1
    a table on sheet 2
    I will assume the table is in column A

    for 2007 or 2010 excel version
    Conditional Formatting

    Highlight applicable range >>
    A:AN on sheet 1

    Home Tab >> Styles >> Conditional Formatting
    New Rule >> Use a formula to determine which cells to format
    Edit the Rule Description: Format values where this formula is true:

    =COUNTIF(Sheet2!$A:$A,$E1)>0

    Format… [Number, Font, Border, Fill]
    choose the format you would like to apply when the condition is true
    OK >> OK
    Attached Files Attached Files
    Wayne
    if my assistance has helped, and only if you wish to , there is an "* Add Reputation" on the left hand side - you can add to my reputation here

    If you have a solution to your thread - Please mark your thread solved do the following: >
    Select Thread Tools-> Mark thread as Solved. To undo, select Thread Tools-> Mark thread as Unsolved.

  3. #3
    Registered User
    Join Date
    06-07-2011
    Location
    USA
    MS-Off Ver
    Excel 2011
    Posts
    6

    Re: Look up Ref on two sheets and highlight a row range.

    Thank you for your reply. What I for got to mention was that a fresh copy of sheet 1 is supplied daily from a different department, as such I do not think a normal conditional formatting does work. I do copy that whole workbook sheet onto sheet 1 in this workbook and "scrub" to my needs. The table on sheet 2 is about 250 reference lines.

    I do have come up with a part solution just not in VBA and it does not do the whole column E just one cell. **** =IF(ISNUMBER(MATCH($E8,$B$2:$B$250,1)),"True",) **** And then just replace "True" with a IF + CONDITIONAL FORMATTING like in the other example listed below :

    Sub ChangeColor() ' Color flags TWD from 3 days to go
    lRow = Range("F" & Rows.Count).End(xlUp).Row
    Set MR = Range("F8:F" & lRow)
    For Each cell In MR
    If cell.Value <= 0 Then cell.Interior.ColorIndex = 3
    If cell.Value = "1" Then cell.Interior.ColorIndex = 6
    If cell.Value = "2" Then cell.Interior.ColorIndex = 6
    If cell.Value = "3" Then cell.Interior.ColorIndex = 43

    Next
    End Sub

  4. #4
    Forum Expert etaf's Avatar
    Join Date
    10-22-2004
    Location
    Wittering, West Sussex, UK
    MS-Off Ver
    365 (Mac OSX) (16.83 (24031120))
    Posts
    8,745

    Re: Look up Ref on two sheets and highlight a row range.

    Sorry, I'm not a VBA expert, I'm sure someone else will reply soon to assist

  5. #5
    Forum Expert
    Join Date
    06-12-2012
    Location
    Ridgefield Park, New Jersey
    MS-Off Ver
    Excel 2003,2007,2010
    Posts
    10,241

    Re: Look up Ref on two sheets and highlight a row range.

    Can you attach a workbook with some sample data to illustrate? To attach a file, push the button with the paperclip (or scroll down to the Manage Attachments button), browse to the required file, and then push the Upload button.

  6. #6
    Registered User
    Join Date
    06-07-2011
    Location
    USA
    MS-Off Ver
    Excel 2011
    Posts
    6

    Re: Look up Ref on two sheets and highlight a row range.

    See attached a small sample data.xlsx
    Thanks
    Attached Files Attached Files

  7. #7
    Registered User
    Join Date
    06-07-2011
    Location
    USA
    MS-Off Ver
    Excel 2011
    Posts
    6

    Re: Look up Ref on two sheets and highlight a row range.

    How do I convert =IF(ISNUMBER(MATCH($E8,$B$2:$B$250,1)),"True",) into VBA and move down to the next row.

    thank you,

  8. #8
    Forum Expert
    Join Date
    06-12-2012
    Location
    Ridgefield Park, New Jersey
    MS-Off Ver
    Excel 2003,2007,2010
    Posts
    10,241

    Re: Look up Ref on two sheets and highlight a row range.

    Quote Originally Posted by TXJM View Post
    How do I convert =IF(ISNUMBER(MATCH($E8,$B$2:$B$250,1)),"True",) into VBA and move down to the next row.

    thank you,
    For instance if you wanted to place it on Column H in Sheet2.

    Please Login or Register  to view this content.
    If you wanted to convert it to values after calculations then you'd just remove the comment.

+ 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 differences of data on 2 sheets
    By steve111 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 03-04-2014, 11:21 AM
  2. [SOLVED] Compare name list (First name, last name) on two different sheets and highlight
    By badboynads in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 10-25-2013, 07:37 AM
  3. Search range of strings with a range of keywords and highlight matches
    By efillner in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 06-12-2013, 04:07 PM
  4. [SOLVED] Highlight range of cells - run macro - select last cell in range
    By chromachem in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 03-24-2012, 11:46 AM
  5. highlight same rows in two sheets
    By aminexcel in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 05-18-2009, 03:23 AM

Tags for this Thread

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