+ Reply to Thread
Results 1 to 3 of 3

VBA Change colour of row if content in column matches array in another sheet

  1. #1
    Forum Contributor
    Join Date
    03-09-2012
    Location
    Isle of Man
    MS-Off Ver
    Excel 2010
    Posts
    118

    VBA Change colour of row if content in column matches array in another sheet

    Hi Folks,

    I have an array in Sheet 1 where column 4 contains client account numbers. The array is called 'EMX' and shows clients that get a discount off their transactions.

    In sheet 2 I have a list of various client transactions. Column T holds the client account number for the transaction.

    As part of a larger macro I run I would like it if the rows in Sheet 2 are yellow if the account number in column T in Sheet 2 appears in column 4 of the array EMX in Sheet 1. If the client account number in column T doesn't appear in the array then the row would remain white or have no fill.

    Is anyone able to provide me with the VBA code that would enable this.

    I hope I've explained this clearly enough.

    As always, any help that you can give me would be greatly appreciated.

  2. #2
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: VBA Change colour of row if content in column matches array in another sheet

    Without seeing the actual workbook it's difficult to be absolutely certain but have you looked first at using conditional formatting rather than assuming VBA is needed.
    Richard Buttrey

    RIP - d. 06/10/2022

    If any of the responses have helped then please consider rating them by clicking the small star icon below the post.

  3. #3
    Forum Contributor
    Join Date
    03-09-2012
    Location
    Isle of Man
    MS-Off Ver
    Excel 2010
    Posts
    118

    Re: VBA Change colour of row if content in column matches array in another sheet

    Hi Richard,

    This code would form part of a larger macro. The data isn't there before the macro is run and the array is created as part of a macro. Users need to run this as a report and aren't too excel savvy.

    Thanks

+ 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. Replies: 2
    Last Post: 11-27-2014, 02:48 PM
  2. [SOLVED] Change colour of every cell in workbook that matches RGB index
    By Bonnister in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 08-21-2014, 11:39 AM
  3. Replies: 2
    Last Post: 02-02-2012, 09:02 AM
  4. Random colour change on cell content input
    By JamesT1 in forum Excel Programming / VBA / Macros
    Replies: 15
    Last Post: 04-13-2010, 08:23 PM
  5. Excel VBA Change text colour depending on another cell's content
    By jell in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 02-15-2010, 11:05 AM
  6. Searching array for date and changing offset colour depeding on combobox content?
    By Simon Lloyd in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 07-02-2006, 07:15 PM
  7. Change colour of cell depending on content
    By blain in forum Excel Programming / VBA / Macros
    Replies: 12
    Last Post: 06-17-2006, 08:47 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