+ Reply to Thread
Results 1 to 6 of 6

Check Expire Date

  1. #1
    Registered User
    Join Date
    02-02-2005
    Posts
    2

    Question Check Expire Date

    Dear Experts :

    I am very new for this area - writting macro in the excel.

    I have one user request us to do checking in her excel sheet, when she open the Excel sheet, if the date ( in one column ) is expire ( greater than system date ), highlight the whole row of data with red color..

    I really don't have any idea, how to do this ?

    Please guide this to me..

    Million thanks
    kuanct

  2. #2
    Forum Expert swatsp0p's Avatar
    Join Date
    10-07-2004
    Location
    Kentucky, USA
    MS-Off Ver
    Excel 2010
    Posts
    1,545
    Conditional formatting should do the trick for her. Assuming the date to check against is in cell A7, highlight desired cells in the row to color red, click Format>Conditional Formatting...

    Set Condition 1 to Formula is and enter =A7<"today()" in the formula box. click Format and then the Patterns tab to select the fill color for the cells.

    click OK, OK to close the dialog box.

    Note: you may want to adjust the font color to yellow to show better against the red background.

    You can then Copy/Paste Special/Formats this range to any other rows that need this formatting.

    HTH
    Bruce
    The older I get, the better I used to be.
    USA

  3. #3
    Registered User
    Join Date
    02-02-2005
    Posts
    2

    Red face Check Expire Date

    Dear Bruce:

    Thanks for your reply. I need more guidence.

    User requested : Column 'Expire Date', if the date value is over due, the column need to highlight in RED color.

    If one month before due date the column highlight in yellow color.

    2 month and above before due date no color shown.

    The excel have more than one sheet.

    If I try to use macro, how is the coding ?

    Thank You & Warm Regards
    kuanct

  4. #4
    Forum Expert swatsp0p's Avatar
    Join Date
    10-07-2004
    Location
    Kentucky, USA
    MS-Off Ver
    Excel 2010
    Posts
    1,545
    What you ask simply requires the addition of a second 'condition'. On the Cond. Formatting box, click "Add>>" and in condition 2 enter:

    Formula Is: =A7<TODAY()+30

    Set your color (yellow) and fonts as desired.

    Now, rows with dates within 30 days of today will be yellow, dates today or older will be red.

    HTH

  5. #5
    Registered User
    Join Date
    02-24-2005
    Posts
    9
    does that only work for cell a7
    what if you have an entire collom of dates

  6. #6
    Forum Expert swatsp0p's Avatar
    Join Date
    10-07-2004
    Location
    Kentucky, USA
    MS-Off Ver
    Excel 2010
    Posts
    1,545
    A7 is simply an example cell reference to be adjusted as needed to meet the set up of the worksheet being used.

    The OP had stated they wanted to check a specific date against the current date [=Today()]. The formatting can then be copied/Paste Special>Formats to as many cells, rows, columns as desired. With a relative cell reference in the formula, it will adjust itself as it is copied to other cells. If you are moving this around, but only checking the date in column "A", fix the reference as: =$A7<"today()"

    Therefore, if the date you want to check against is in D12 (for example), just change the formula to read =D12<"today()", or fix the reference as =$D12<"today()" as needed.

    HTH

+ 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