excel macro formated to highlight current date

15 pts.
Tags:
Microsoft Excel
Microsoft Excel 2003
Microsoft Excel macros
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.

Answer Wiki

Thanks. We'll let you know when a new response is added.

This website 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.

Discuss This Question: 2  Replies

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
  • Jlcford
    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 pointsBadges:
    report
  • BobBeechey
    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 pointsBadges:
    report

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following