Reputation: 990
I'd like to use the simplest way to highlight the Today() date in a cell.
I have columns with dates listed from the first day of the month till the last one.
I would like to see the cell highlighted according to the TODAY() date...
Is there a simple way to achieve it?
The way I create the list is by adding a fixed date like 07/01/2023
And then I just drag it till the date I need.
Upvotes: 2
Views: 18809
Reputation: 11
There is inbuilt function called "Highlight Cells Rules" under "Conditional Formatting" in home tab. Select Full full column or particular cell then go to Home > style > Conditional formatting > Highlight Cells Rules then select "A date occurring". Select the required day then select required formatting of cell and its done.
Upvotes: 1
Reputation: 21683
I would use conditional formatting. This will also work on Excel via web (whereas VBA will not work via web) and it's simple.
Select the range of date cells, hit "Conditional Formatting", then Manage Rules, the add new rule, set the formula = = <<FirstCellInRangeHere>> = Today()
, choose how you want to format it and that's it..
Here's a 30 second GIF to show it being applied. (Right click and open in new window if it's not clear)
Upvotes: 5
Reputation: 6097
Place this code in the sheet code pane
Private Sub Worksheet_Change(ByVal Target As Range)
For Each c In UsedRange
If (c) = DateValue(Now()) Then c.Interior.Color = xlGreen
Next c
End Sub
Coloring is activated when the Sheet changes.
Set the color (xlGreen) to the desired value.
Upvotes: 1