+ Reply to Thread
Results 1 to 6 of 6

Apply color code to only 3 columns of filtered range

  1. #1
    Valued Forum Contributor
    Join Date
    03-23-2008
    Location
    Tennessee
    MS-Off Ver
    Office 2007
    Posts
    706

    Apply color code to only 3 columns of filtered range

    Me again, Gurus.

    The following code filters my sheet to show only values less than 0 in column T, (column 20).

    Please Login or Register  to view this content.
    Now I want to color code the filtered cells Red, but only in columns 18, 19 and 20, (R, S and T). The following code would color ALL cells in the filtered region, but I don't know how to color only columns R thru T.

    Please Login or Register  to view this content.
    Thanks in advance for any help you can offer.
    Last edited by [email protected]; 10-08-2009 at 11:11 AM.

  2. #2
    Forum Expert Palmetto's Avatar
    Join Date
    04-04-2007
    Location
    South Eastern, USA
    MS-Off Ver
    XP, 2007, 2010
    Posts
    3,978

    Re: Apply color code to only 3 columns of filtered range

    Why not just use Conditional formatting?
    Palmetto

    Do you know . . . ?

    You can leave feedback and add to the reputation of all who contributed a helpful response to your solution by clicking the star icon located at the left in one of their post in this thread.

  3. #3
    Valued Forum Contributor
    Join Date
    03-23-2008
    Location
    Tennessee
    MS-Off Ver
    Office 2007
    Posts
    706

    Re: Apply color code to only 3 columns of filtered range

    Thanks for the reply, Palmetto.

    Conditional formatting would work for the one column containing the number less than 0, but the contents of the other two columns would vary. They consist of Text and Dates. I don't know what conditions I could apply to those cells.

  4. #4
    Forum Expert Palmetto's Avatar
    Join Date
    04-04-2007
    Location
    South Eastern, USA
    MS-Off Ver
    XP, 2007, 2010
    Posts
    3,978

    Re: Apply color code to only 3 columns of filtered range

    You would use the same CF formula to apply to all of the cells in the target column using an absolute reference in the formula.

    CF formula: =$T2=0

    Select all of the cells for which to apply the CF, making sure T2 is the first cell in the selection (assume row1 to be header).

    The apply the CF using the formula above.

  5. #5
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Apply color code to only 3 columns of filtered range

    Your programming query is resolved like so:
    Please Login or Register  to view this content.
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    ?None of us is as good as all of us? - Ray Kroc
    ?Actually, I *am* a rocket scientist.? - JB (little ones count!)

  6. #6
    Valued Forum Contributor
    Join Date
    03-23-2008
    Location
    Tennessee
    MS-Off Ver
    Office 2007
    Posts
    706

    Re: Apply color code to only 3 columns of filtered range

    Sorry so slow to respond, guys. I had meetings all morning.

    The programming solution is the best fit for my purposes, as this would be just part of a pretty lengthy macro. After testing this morning, the code works perfectly. Thanks, JB! And thanks to BOTH of you for taking the time to respond to my cry for help.

    Have a good one!!

+ 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