Macro that inserts a date


Posted by Ben on December 15, 2000 2:27 PM

How do I create a macro that puts the date that it was run into cell A2, in the format DD/MM/YY?

Thanks!



Posted by Celia on December 15, 2000 4:44 PM


If you just want the date formatted as text :-
Range("A2").Value = Format(Now(), "dd/mm/yy")

If you want it in date format :-
With Range("A2")
.Value = Now()
.NumberFormat = "dd/mm/yy"
End With