Macro / VB / Instert Date Question

G

Guest

I am building a macro and would like the macro to update a cell to say "Data
Locked - <date when macro was run>". I have tried to used the CTRL+; command
to insert the date, but when recording the macro, the actual date text is
recorded and I am stuck with a date that is hardcoded to the time I built the
macro. Any thoughts?

Thanks!
 
J

JulieD

Hi

not sure if i'm missing something here, but if in your macro it has
something along the lines of


'your current code
Range("A1").value = Format(NOW(),"dd/mm/yyyy")
'your current code

every time you run the macro, the date of running the macro will be inserted
into A1

Cheers
JulieD
 
B

Bob Phillips

Activesheet,Range("H10").Value = "Data Locked - " &
Format(Date,"yyyy-mm-dd")

--

HTH

RP
(remove nothere from the email address if mailing direct)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top