+ Reply to Thread
Results 1 to 7 of 7

Change the Coloring of Cells based on date

  1. #1
    Registered User
    Join Date
    10-19-2009
    Location
    Calgary
    MS-Off Ver
    Excel 2003
    Posts
    4

    Change the Coloring of Cells based on date

    I need a macro that will search entire worksheet and if a date is listed, check that date and do the following:
    1. If the date is greater then 60 days from todays date, do nothing.
    2. If the date is less then 60 days from todays date, change the cell color to yellow.
    3. If the date is less then 30 days from todays date, change the cell color to orange.
    4. If the date is equal to or older then todays date, change the cell color to red.

    Help!

  2. #2
    Registered User
    Join Date
    10-19-2009
    Location
    Calgary
    MS-Off Ver
    Excel 2003
    Posts
    4

    Re: Change the Coloring of Cells based on date

    So basically on the above:
    #2 should be from 60-31 days from todays date.
    #3 should be 30-1 day(s) from todays date.
    #3 should be 1 day or older from todays date

  3. #3
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: Change the Coloring of Cells based on date

    Would you consider a non-macro approach using Conditional Formatting?
    Where there is a will there are many ways.

    If you are happy with the results, please add to the contributor's reputation by clicking the reputation icon (star icon) below left corner

    Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.

  4. #4
    Registered User
    Join Date
    10-19-2009
    Location
    Calgary
    MS-Off Ver
    Excel 2003
    Posts
    4

    Re: Change the Coloring of Cells based on date

    Yes, whatever works as long as it checks this and updates the worksheet every time its open.

  5. #5
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: Change the Coloring of Cells based on date

    Select the columns (ranges of interest) and go to Format|Conditional Formatting

    Choose Formula Is, Enter: =And(A1<=Today()+60,A1>Today()+30)

    click Format and choose from Pattern tab.

    Click Ok

    Click Add

    Choose Formula Is: Enter: =And(A1<=Today()+1,A1<>"")

    click Format and choose from Pattern tab.

    Click Ok

    Click Add

    Choose Formula Is: Enter: =And(A1<=Today(),A1<Today()+30)

    click Format and choose from Pattern tab.

    Click Ok

    Click Ok


    Note: These formulas assume your selected range has cell A1 at top-left most corner. Adjust that in the formulas if necessary to suit

  6. #6
    Registered User
    Join Date
    10-19-2009
    Location
    Calgary
    MS-Off Ver
    Excel 2003
    Posts
    4

    Re: Change the Coloring of Cells based on date

    I see it only does 3 condidtions, but wouldn't I need 4:
    1)Do Nothing
    2)one for the 60 day check
    3)one for the 30 day check
    4)one for the today an older check

    ?

  7. #7
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: Change the Coloring of Cells based on date

    Do Nothing doesn't need a condition... it is the default

+ 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