+ Reply to Thread
Results 1 to 5 of 5

Conditional Formatting of Font Color based on Values in another cell

  1. #1
    Registered User
    Join Date
    03-22-2010
    Location
    London
    MS-Off Ver
    2007
    Posts
    49

    Question Conditional Formatting of Font Color based on Values in another cell

    Hi everyone

    I was hoping you could help me with some VB code for conditionally formatting a column of cells...

    I have attached a dummy workbook, and basically the values in column F are in white. I would like these values to turn to black font, but only after all the corresponding values in column H have been filled in (between 1-5).

    I have a macro in my actual workbook, which is why I need it as code and not a formula in the cell.

    Thanks for your help!!

    DP
    Attached Files Attached Files
    Last edited by dpcp; 01-23-2012 at 07:50 PM.

  2. #2
    Forum Contributor
    Join Date
    06-16-2011
    Location
    London
    MS-Off Ver
    Excel XP
    Posts
    276

    Re: Conditional Formatting of Font Color based on Values in another cell

    Haven't looked at your workbook but.....see below for the code to change cell formatting. Put the vba code into the change event of your worksheet so it runs every time a user enters a value anywhere.

    Please Login or Register  to view this content.

  3. #3
    Registered User
    Join Date
    03-22-2010
    Location
    London
    MS-Off Ver
    2007
    Posts
    49

    Re: Conditional Formatting of Font Color based on Values in another cell

    I've put it in but I get an error. Also, not all the cells in column H will have values between 1-5, and it depends on the rest of the macro how many rows there will actually be... bu for this one, I need something that says
    "If all cells H4:H25 have a value between 1-5, then font colour in all cells F4:F25 = black"

  4. #4
    Forum Contributor
    Join Date
    06-16-2011
    Location
    London
    MS-Off Ver
    Excel XP
    Posts
    276

    Re: Conditional Formatting of Font Color based on Values in another cell

    Just to be clear here: "If every cell in the range H4:H25 has a value between 1-5, then font colour in every cell in the range F4:F25 turns black, otherwise it's white"?

    ok. Try this:

    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    03-22-2010
    Location
    London
    MS-Off Ver
    2007
    Posts
    49

    Re: Conditional Formatting of Font Color based on Values in another cell

    Thank you so much, that seems to work perfectly

  6. #6
    Forum Contributor
    Join Date
    06-16-2011
    Location
    London
    MS-Off Ver
    Excel XP
    Posts
    276

    Re: Conditional Formatting of Font Color based on Values in another cell

    You're very welcome.

+ 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