+ Reply to Thread
Results 1 to 5 of 5

VBA to change font color of range of cells based on text not in another cell

  1. #1
    Registered User
    Join Date
    10-16-2012
    Location
    Fort Lauderdale, FL
    MS-Off Ver
    Excel 2003
    Posts
    4

    VBA to change font color of range of cells based on text not in another cell

    Hi, I have tried to search this site and tweak code to get what I need (very new to using code), but can't find it. I want to change the font in columns N through AN starting on line 16 until basically the end of the sheet (as the user can enter hundreds of lines) to dark grey (leaving the existing fill and borders) only if the value in column M for that line does not equal "Current License" or "Select". Therefore if the line is blank, or Current License or Select are displayed, the current format and font will be displayed. Because the file will contain a massive amount of data, I would like to use code rather than conditional formatting. Thank you for your help!
    Attached Files Attached Files

  2. #2
    Forum Contributor
    Join Date
    09-27-2012
    Location
    London, England
    MS-Off Ver
    2003, 2010
    Posts
    344

    Re: VBA to change font color of range of cells based on text not in another cell

    Hi - Try this:

    Please Login or Register  to view this content.

    Please note, there was a sheet change event enabled that I had disabled while trying this code and worked fine.

    Hope this helps...
    If solved kindly remember to mark Thread as solved.
    Click the small star icon at the bottom left of my post if this was useful.

  3. #3
    Valued Forum Contributor
    Join Date
    06-19-2010
    Location
    Holywell, N Wales, UK
    MS-Off Ver
    Excel 2013
    Posts
    470

    Re: VBA to change font color of range of cells based on text not in another cell

    When do you want the color change to take place:
    with a new entry?
    at the press of a button?
    on opening the worksheet?
    If this was helpful then please click the small star icon at the bottom left of my post. A little appreciation goes a long way.

  4. #4
    Registered User
    Join Date
    10-16-2012
    Location
    Fort Lauderdale, FL
    MS-Off Ver
    Excel 2003
    Posts
    4

    Re: VBA to change font color of range of cells based on text not in another cell

    Hi...thank you for the fast response. I just pasted in the code and it doesn't seem to be working. What could I be doing wrong? What did you have to disable (the macro that turned the cells red if a forumula was changed)? Thanks again for your help, I really appreciate it!

  5. #5
    Registered User
    Join Date
    10-16-2012
    Location
    Fort Lauderdale, FL
    MS-Off Ver
    Excel 2003
    Posts
    4

    Re: VBA to change font color of range of cells based on text not in another cell

    The spreadsheet is a template that will have the formulas copied down to about line 200. Upon selection of the cell in Column M (which is basically the license # (ie not Current License or Select), then I would like the font for cells from N to AP on that row to change to a dark gray color. Because these cells will have a lighter font, the user and the reviewer will know that these cells on that row do not relate to the current license (they were the previous licenses). I hope this helps! Thanks for the question!.

+ 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