+ Reply to Thread
Results 1 to 10 of 10

VB Code to highlight matching cell

  1. #1
    Valued Forum Contributor
    Join Date
    01-18-2007
    Location
    Georgia
    MS-Off Ver
    2010
    Posts
    4,434

    VB Code to highlight matching cell

    Hello:

    Please refer to attached file.
    Data is from column K onwards
    I need VB Code to do following.
    Need to go thru data from cell Y2 down to end.
    Example:
    Cell Y2 = 188.15, Date W2 is 1/1/2018
    Need to go thru Data in column L thru Column V for 6 days and if it finds matching data then highlight
    Cell Y2 to be GREEN and highlight GREEN in the cell matching in Column L thru V

    I have highlighted 3 found data.


    Let me know if you have any questions.
    Thanks.

    Riz
    Attached Files Attached Files

  2. #2
    Forum Expert
    Join Date
    10-06-2017
    Location
    drevni ruchadlo
    MS-Off Ver
    old
    Posts
    2,143

    Re: VB Code to highlight matching cell

    1. Can the value, e.g. 188,15 (Y2), occur only once in the range of six daily dates (in this case range L2:V7), or many times ?
    2. Should the value 188,15 (Y2) be searched only once in the first block of six daily dates (in this case range L2:V7), or in the next six-day blocks also (i.e. in ranges: L8:V13, L14:V19, L20:V25 ... etc.) up to the end of the data table ?

  3. #3
    Valued Forum Contributor
    Join Date
    01-18-2007
    Location
    Georgia
    MS-Off Ver
    2010
    Posts
    4,434

    Re: VB Code to highlight matching cell

    Hello:

    It will happen only one time.
    Yes to you answer.
    Thanks

    Riz

  4. #4
    Forum Expert
    Join Date
    12-10-2006
    Location
    Sydney
    MS-Off Ver
    Office 365
    Posts
    3,523

    Re: VB Code to highlight matching cell

    Hi rizmomin,

    Try this:

    Please Login or Register  to view this content.
    Regards,

    Robert
    Last edited by Trebor76; 12-16-2018 at 09:00 PM.
    ____________________________________________
    Please ensure you mark your thread as Solved once it is. Click here to see how
    If this post helps, please don't forget to say thanks by clicking the star icon in the bottom left-hand corner of my post

  5. #5
    Forum Expert
    Join Date
    10-06-2017
    Location
    drevni ruchadlo
    MS-Off Ver
    old
    Posts
    2,143

    Re: VB Code to highlight matching cell

    Quote Originally Posted by rizmomin View Post
    1. It will happen only one time.
    2. Yes to you answer
    Ad 1. Ok, it's clear

    Ad 2. What 'Yes' ? ... ... little understood answer, very scant ... but try this:
    Please Login or Register  to view this content.

  6. #6
    Valued Forum Contributor
    Join Date
    01-18-2007
    Location
    Georgia
    MS-Off Ver
    2010
    Posts
    4,434

    Re: VB Code to highlight matching cell

    Hello Trebor76:

    Seems like its working but need to tweak little.
    Its only highlighting in column L.
    Check cell M9 and N9 which needs to be highlighted.

    Attached is the result after run your code.

    Riz
    Attached Files Attached Files

  7. #7
    Forum Expert
    Join Date
    12-10-2006
    Location
    Sydney
    MS-Off Ver
    Office 365
    Posts
    3,523

    Re: VB Code to highlight matching cell

    Hi Riz,

    Sorry - my bad. Just change this line...

    Please Login or Register  to view this content.
    to this:

    Please Login or Register  to view this content.
    Regards,

    Robert

  8. #8
    Forum Expert
    Join Date
    12-10-2006
    Location
    Sydney
    MS-Off Ver
    Office 365
    Posts
    3,523

    Re: VB Code to highlight matching cell

    As long as there's only ever one match, here's another way:

    Please Login or Register  to view this content.
    Robert

  9. #9
    Valued Forum Contributor
    Join Date
    01-18-2007
    Location
    Georgia
    MS-Off Ver
    2010
    Posts
    4,434

    Re: VB Code to highlight matching cell

    Hello Trebor76 and others

    Thanks a lot

    Riz

  10. #10
    Forum Expert
    Join Date
    12-10-2006
    Location
    Sydney
    MS-Off Ver
    Office 365
    Posts
    3,523

    Re: VB Code to highlight matching cell

    You're welcome. Thanks for marking the thread as solved and the rep

+ 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. Format/Highlight Rows with matching cell values Using "String"
    By ExcelMasterIamNot in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 08-03-2016, 06:32 PM
  2. [SOLVED] VB Code to highlight the cell
    By rizmomin in forum Excel Programming / VBA / Macros
    Replies: 13
    Last Post: 04-18-2016, 01:36 AM
  3. [SOLVED] Highlight cell based on selected cell - Code required
    By SharpL in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 09-24-2014, 09:48 AM
  4. [SOLVED] VBA code to highlight a range when cell value is FB01
    By fatalcore in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 03-30-2013, 12:21 AM
  5. [SOLVED] VBA code to highlight rows based on a cell
    By mugs62 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 10-11-2012, 07:08 AM
  6. code not working to highlight a cell if blank
    By curbster in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 08-27-2009, 09:07 PM
  7. Code to highlight cell
    By Denzil in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 08-12-2008, 11:25 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