Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 11
Default Insert Time Stamp when macro is run

Hi All,

I'm generating reports using macros. I would like to Insert a time stamp
when the macro is run. Can you please let me know how?

I'm aware of =Now() to insert time stamp. But like to insert actual time
when the user runs the macro.

Thanks,
Nagesh
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 4,624
Default Insert Time Stamp when macro is run

One way:

Public Sub try()
Range("A1").Value = Time
'rest of the macro
End Sub

In article ,
Nagesh wrote:

Hi All,

I'm generating reports using macros. I would like to Insert a time stamp
when the macro is run. Can you please let me know how?

I'm aware of =Now() to insert time stamp. But like to insert actual time
when the user runs the macro.

Thanks,
Nagesh

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 11
Default Insert Time Stamp when macro is run

Hi JE McGimpsey,

Your solution works, but the date is inserted as 1/1/1900..I have instead
used =now() instead of Time

Thanks for getting me going


"JE McGimpsey" wrote:

One way:

Public Sub try()
Range("A1").Value = Time
'rest of the macro
End Sub

In article ,
Nagesh wrote:

Hi All,

I'm generating reports using macros. I would like to Insert a time stamp
when the macro is run. Can you please let me know how?

I'm aware of =Now() to insert time stamp. But like to insert actual time
when the user runs the macro.

Thanks,
Nagesh


  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 4,624
Default Insert Time Stamp when macro is run

Hmm.. Doesn't here.

Another way:

Public Sub try()
With Range("A1")
.Value = Time
.NumberFormat = "00:00:00"
End With
'rest of macro
End Sub

In article ,
Nagesh wrote:

Your solution works, but the date is inserted as 1/1/1900..I have instead
used =now() instead of Time

Thanks for getting me going


"JE McGimpsey" wrote:

One way:

Public Sub try()
Range("A1").Value = Time
'rest of the macro
End Sub

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
how do i auto insert a date and time stamp cjensen Excel Discussion (Misc queries) 3 February 6th 07 03:44 AM
Time Stamp DAI Excel Worksheet Functions 8 November 27th 06 07:23 PM
Time Stamp sunderland27 Excel Discussion (Misc queries) 3 April 19th 06 07:05 PM
Insert Automatic, Non-Updating Date Stamp Ken Zenachon Excel Discussion (Misc queries) 8 January 18th 06 06:52 PM
Time Stamp Richard Excel Discussion (Misc queries) 4 February 2nd 05 11:16 PM


All times are GMT +1. The time now is 04:52 PM.

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

About Us

"It's about Microsoft Excel"