+ Reply to Thread
Results 1 to 2 of 2

set cell fill color based on multiple conditions

  1. #1
    Registered User
    Join Date
    02-21-2011
    Location
    Canada
    MS-Off Ver
    Excel 2007
    Posts
    30

    set cell fill color based on multiple conditions

    Hi,
    I have a worksheet with several columns and 500 rows, I need a VBA script or formula that will check one of 3 conditions

    the cells are B3 H3 N3 the key cell is N3

    1- if N3 contains the word ball then check the conditions of B3 and H3 and proceed to set 2 and 3. if not, then do nothing

    2- If N3 contains the word "ball" and B3 contains "P1" and H3 is "=<2:00:00" hours then set H3 cell fill color to green; but if H3 is >2:00:00 set H3 fill color to Red

    or if cell B3 contains "P2"

    3- If N3 contains the word "ball" and B3 contains "P2" and H3 is "=<6:00:00" hours then set H3 cell fill color to green; but if H3 is >6:00:00 set H3 fill color to Red

    once it check row 3 I need it to then check all the rows in the sheet and run the code as required
    Last edited by StartingOut; 06-29-2011 at 10:46 AM.

  2. #2
    Forum Expert p24leclerc's Avatar
    Join Date
    07-05-2010
    Location
    Québec
    MS-Off Ver
    Excel 2021
    Posts
    2,081

    Re: set cell fill color based on multiple conditions

    With conditional formatting you can do what you want. see attached file.
    Attached Files Attached Files

+ 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