Colour Cells basis current date

VJOSHI

New Member
Joined
Sep 16, 2014
Messages
7
New to macros..I am trying to colour format cells using macro as manual formatting it's increasing the file size.

Want to see if can build a macro that colours the cell range basis of value obtained from current date and format the list of data with respective colours till the last row data is filled.

Column E data is 'date' which I am using to obtain value in cells H:I:J:K BY Adding days I have to complete an activity. I want to use current date to determine when activity is pending for action (though the dates show this but need to highlight as my staff tend to miss on that):(.


If value in column H:K is <= than today() colour = Red
If value in column H:K is = today()+1day colour = Yellow
If value in column H:K is = today()+2days colour = Green

Not sure how to go abt that.
 
Last edited:

Excel Facts

Whats the difference between CONCAT and CONCATENATE?
The newer CONCAT function can reference a range of cells. =CONCATENATE(A1,A2,A3,A4,A5) becomes =CONCAT(A1:A5)
I can give you a pinpointer.

Just loop the code below,
Code:
If Range("H1") <= Date Then
     Range("H1").Interior.ColorIndex = vbRed
End If

or you could also use Conditional formatting.

EDIT:
This link should show you how to conditional format
 
Last edited:
Upvote 0
Highlight the range .
Go to Conditional Formatting and enter as follows
1st condition Formula is =H1=Today() Format Red
2nd condition Formula is =H1=Today()+1 Format Yellow
3rd condition Formula is =H1=Today()+2 Format Green

Be aware that each day the Today function will recognise today’s date as TODAY ; it is not fixed.

Pedro
 
Upvote 0
Highlight the range .
Go to Conditional Formatting and enter as follows
1st condition Formula is =H1=Today() Format Red
2nd condition Formula is =H1=Today()+1 Format Yellow
3rd condition Formula is =H1=Today()+2 Format Green

Be aware that each day the Today function will recognise today’s date as TODAY ; it is not fixed.

Pedro

I would think that is what he wants. the dates beeing checked will be static, the checking will be dynamic.
 
Upvote 0

Forum statistics

Threads
1,223,423
Messages
6,172,029
Members
452,443
Latest member
Edmundo Cruz

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top