Hi,
I need help writing a macro. Column D is filled with various dates. D2 might be 23/05/2010, D3 might be 12/06/2010, etc. While Cell in Column E might contain text, e.g. "Exceed Target Date", etc. Also, the number of rows is unknown and may be as large as a thousand or more. There also might be blank cells in the column too.
I need a macro that will go through Column D and Column G separately and change the Fill Color based on criteria, compared to today's date:
- If the date in the cell is prior to today's date, the cell's fill color should change to red
- If the date in the cell is the same as today's date, the cell's fill color should change to yellow
- If the date in the cell is 1 or 2 days after today, the cell's fill color should change to green
- If the date is 3 days or beyond after today's date, or if the cell contains text or is blank, the cell should remain white (or be filled with white, if it wasn't already)
And i would also like Cell in Column E turns to red, whenever the target date is passed.
Ideally, this macro should be run everytime the excel document is opened. Additionally, the code needs to change things appropriately. For example, if I open the document today (21/06/2010) and it finds the date 22/06/2010, it should change that fill to red. Then when I open tomorrow, since the date will now be today's date, it should change the red to yellow, as per the criteria above.
Your help is highly appreciated.<!-- / message --><!-- BEGIN TEMPLATE: ad_showthread_firstpost_sig --><!-- END TEMPLATE: ad_showthread_firstpost_sig -->
I need help writing a macro. Column D is filled with various dates. D2 might be 23/05/2010, D3 might be 12/06/2010, etc. While Cell in Column E might contain text, e.g. "Exceed Target Date", etc. Also, the number of rows is unknown and may be as large as a thousand or more. There also might be blank cells in the column too.
I need a macro that will go through Column D and Column G separately and change the Fill Color based on criteria, compared to today's date:
- If the date in the cell is prior to today's date, the cell's fill color should change to red
- If the date in the cell is the same as today's date, the cell's fill color should change to yellow
- If the date in the cell is 1 or 2 days after today, the cell's fill color should change to green
- If the date is 3 days or beyond after today's date, or if the cell contains text or is blank, the cell should remain white (or be filled with white, if it wasn't already)
And i would also like Cell in Column E turns to red, whenever the target date is passed.
Ideally, this macro should be run everytime the excel document is opened. Additionally, the code needs to change things appropriately. For example, if I open the document today (21/06/2010) and it finds the date 22/06/2010, it should change that fill to red. Then when I open tomorrow, since the date will now be today's date, it should change the red to yellow, as per the criteria above.
Your help is highly appreciated.<!-- / message --><!-- BEGIN TEMPLATE: ad_showthread_firstpost_sig --><!-- END TEMPLATE: ad_showthread_firstpost_sig -->