Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default How to get the time stamp in VBA for EXCEL

I want to record current time (Hour-Minutes-Second) in
VBA.How to accomplish with VB code,use what system
function call
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 102
Default How to get the time stamp in VBA for EXCEL

Hi Ji,
Try this,

Sub TimeStamper()
Range("A1").Value = Now
Range("A1").NumberFormat = "H:MM AM/PM"
End Sub

Regards, Rocky McKinley


"Ji Wenke" wrote in message
...
I want to record current time (Hour-Minutes-Second) in
VBA.How to accomplish with VB code,use what system
function call



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 102
Default How to get the time stamp in VBA for EXCEL

Hi Ji,
Oops should have included ":SS" as below,

Sub TimeStamper()
Range("A1").Value = Now
Range("A1").NumberFormat = "H:MM:SS AM/PM"
End Sub

Regards, Rocky McKinley


"Ji Wenke" wrote in message
...
I want to record current time (Hour-Minutes-Second) in
VBA.How to accomplish with VB code,use what system
function call





  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10
Default How to get the time stamp in VBA for EXCEL

On Wed, 13 Aug 2003 20:24:04 -0700, "Ji Wenke"
wrote in microsoft.public.excel.programming:

I want to record current time (Hour-Minutes-Second) in
VBA.How to accomplish with VB code,use what system
function call


I probably misunderstand the question, but doesn't:
Hour(Now) & "-" & Minute(Now) & "-" & Second(Now)
work for you?
(Nit pick: the above might give unexpected results when its execution
straddles midnight.)

--
Michael Bednarek, IT Manager, Tactical Global Management
Waterfront Pl, Brisbane 4000, Australia. "POST NO BILLS"
http://mcmbednarek.tripod.com/
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
remove time stamp from date in excel Nmeyer Excel Worksheet Functions 7 November 14th 07 02:46 PM
EXCEL GLOBAL DATE AND TIME STAMP BUZZ55 Excel Discussion (Misc queries) 1 December 7th 06 05:21 PM
Add time and date stamp to Excel comments. Ahmed Madkour Excel Discussion (Misc queries) 2 May 26th 06 01:57 PM
Time stamp in Excel Sheet John M Excel Discussion (Misc queries) 3 June 28th 05 02:05 PM
How do I make a time Stamp in excel? Ben Excel Discussion (Misc queries) 4 April 22nd 05 08:37 PM


All times are GMT +1. The time now is 06:04 AM.

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"