What syntax do I use to add todays date in an excel macro

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I'm using office 2003 and would like to add todays date to a specific cell
during the running of a macro.
What is the syntax to accomplish this?

(when I record a macro I can select the cell I want but I figure the date
component has to be typed into the macro manually, ie edit macro and add the
required syntax)
 
with activesheet.range("b99")
.value = date
.numberformat = "mm/dd/yyyy"
end with

There's also now and time:

.value = now 'includes both time & date
.value = time 'just the time
.value = date 'just the date
 
Back
Top