I have a calendar in an excel workbook that I would like to develop a macro that could be formated to highligt the current date. I have my dates formated as the serial date. When I write my macro it highlights the same "number" "=DAY(TODAY())" in every month.
Software/Hardware used:
ASKED:
September 24, 2008 5:19 PM
UPDATED:
September 26, 2008 6:58 AM
Thanks for your response. I have tried the Today() alone and it does pick up any of the days thats why I added the “DAY” to the statement. I am currently trying this macro, but am getting an error reading. Do you have any idea were I am going wrong with my syntax?
Sub CurrentDate() With Range("C5:AG5") .FormatConditions.Add Type:=xlCellValue, Operator:=x1Equal, Formula1:="=TODAY()" .FormatConditions(1).Interior.ColorIndex = 1 End With End SubVB & and Excel don’t like the “Formula1:=” part of the statement
Labnuke99,
The code is fine except the Operator value should be xlEqual and NOT x1Equal, in other words you used a one where there should be an ell. It took me a while to spot that!!