+ Reply to Thread
Results 1 to 3 of 3

Change cell color based upon partial cell contents

  1. #1
    Registered User
    Join Date
    10-28-2011
    Location
    Lehigh Valley, PA
    MS-Off Ver
    Excel 2007
    Posts
    18

    Change cell color based upon partial cell contents

    Hi,

    Thanks for taking the time to help.

    Looking for a sub that will look though column of "A" and if a cell contains:

    "F D" make text bold and brown (.Color = -16764058)
    "F T" make text bold and green (.Color = -16744448)
    "F A" make text bold and purple (.Color = -3407719)
    Attached Files Attached Files

  2. #2
    Forum Expert teylyn's Avatar
    Join Date
    10-28-2008
    Location
    New Zealand
    MS-Off Ver
    Excel 365 Insider Fast
    Posts
    11,372

    Re: Change cell color based upon partial cell contents

    Hello,

    why do you want a macro for that? Excel can do this out of the box with conditional formatting.

    Select all cells, starting with A1 and enter three conditional formatting rules: Home ribbon > conditional formatting > new rule > use a formula to determine

    First rule:
    =FIND("F D",TRIM(A2)) -- brown

    second rule
    =FIND("F T",TRIM(A2)) -- green

    third rule
    =FIND("F A",TRIM(A2)) -- purple

    cheers,

  3. #3
    Registered User
    Join Date
    10-28-2011
    Location
    Lehigh Valley, PA
    MS-Off Ver
    Excel 2007
    Posts
    18

    Re: Change cell color based upon partial cell contents

    Hi Teylyn,

    Thanks for the reply.

    Maybe in my attempt to keep things simple I oversimplified too much.

    The reason I am looking for a sub routine is because it will be inserted as part of a much larger macro that is run on many different files everyday.
    The larger macro copies the (soon to be formatted) data from this column elsewhere (to a single cell) on the spreadsheet before deleting this column.

    As a stand alone, based on my oversimplified attached spreadsheet, yes your solution does the trick.

    Hope this makes things a bit clearer.
    Last edited by msmick; 01-14-2012 at 01:28 AM.

+ 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