15 pts.
 excel macro formated to highlight current date
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

Answer Wiki:
This <a href="http://www.cpearson.com/excel/mainpage.aspx">website</a> is one of the best Excel resources I have found. It is likely going to have the answer to your question. Your expression, =day(today()) is doing what it is supposed to. It returns the number (24) that corresponds to the day in today's date, not a date. I don't know what your macro is doing, but the embedded function =today() will return a date - it is probably what you want to use.
Last Wiki Answer Submitted:  September 24, 2008  6:01 pm  by  Labnuke99   32,645 pts.
All Answer Wiki Contributors:  Labnuke99   32,645 pts.
To see all answers submitted to the Answer Wiki: View Answer History.


Discuss This Question:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _


 

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 Sub

VB & and Excel don’t like the “Formula1:=” part of the statement

 15 pts.

 

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!!

 750 pts.