Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7
Default Macro / VB / Instert Date Question

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!
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 618
Default Macro / VB / Instert Date Question

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




"Spyder" wrote in message
...
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!



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default Macro / VB / Instert Date Question


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

--

HTH

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


"Spyder" wrote in message
...
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!



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Excel 2007 Macro/VB Question DDE Question MadDog22 Excel Worksheet Functions 1 March 10th 10 01:47 AM
Can no longer instert symbol in text box Rutabaga Excel Discussion (Misc queries) 1 March 25th 09 03:10 PM
Date question Bri Excel Worksheet Functions 2 February 8th 06 02:36 AM
A macro for the today's date...not the current date abxy[_18_] Excel Programming 7 February 8th 04 11:05 PM
Date Question Don Guillett[_4_] Excel Programming 0 August 8th 03 02:55 PM


All times are GMT +1. The time now is 08:30 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"