Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Raj
 
Posts: n/a
Default How to write a macro to get the system time in excel 97


  #2   Report Post  
Dave Peterson
 
Posts: n/a
Default

Option Explicit
Sub testme()

MsgBox Now
MsgBox Date
MsgBox Format(Now, "hh:mm:ss")

End Sub


Raj wrote:

--

Dave Peterson
  #3   Report Post  
Mexage
 
Posts: n/a
Default

You can also use the formulas directly into the cell:

=Date()
for Just the date

=Now()
for Date and time

and

=Now()-Date()
for just the time
"Raj" wrote:


  #4   Report Post  
Don Guillett
 
Posts: n/a
Default

From now on - Do NOT put your question in the subject line. Put a meaningful
subject line such as "sytem time" and ask your question in the BODY of the
message.

Sub gettime()
MsgBox Time
End Sub

--
Don Guillett
SalesAid Software

"Raj" wrote in message
...



  #5   Report Post  
Mexage
 
Posts: n/a
Default

I suggest that we act politely, and instead of giving orders we orientate
people.

:-) Have a nice day!

"Don Guillett" wrote:

From now on - Do NOT put your question in the subject line. Put a meaningful
subject line such as "sytem time" and ask your question in the BODY of the
message.

Sub gettime()
MsgBox Time
End Sub

--
Don Guillett
SalesAid Software

"Raj" wrote in message
...






  #7   Report Post  
David McRitchie
 
Posts: n/a
Default

Depends on what you are looking for as the system time.
VBA time functions Now, Time include truncated seconds.
The VBA timer function about the same though it differs on PC and MAC
PC version really only attempts to show seconds. (on a PC it show .0 or .5 seconds).

The Excel NOW Worksheet Function is accurate to 10ms.

For a comparison of the Date and Time worksheet functions to the
VBA functions (I am using Excel 2000) see
http://www.mvps.org/dmcritchie/excel...htm#comparison

If you are interested in timing something see
http://www.mvps.org/dmcritchie/excel/slowresp.htm#timer
based on
"How To Use QueryPerformanceCounter to Time Code"
http://support.microsoft.com/kb/172338/EN-US/

---
HTH,
David McRitchie, Microsoft MVP - Excel [site changed Nov. 2001]
My Excel Pages: http://www.mvps.org/dmcritchie/excel/excel.htm
Search Page: http://www.mvps.org/dmcritchie/excel/search.htm

"Raj" wrote .
(question was missing as already mentioned)


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 to write macro after autofilter is applied emre Excel Worksheet Functions 2 March 31st 05 02:59 PM
Running a macro at a certain time Tam Excel Discussion (Misc queries) 3 March 2nd 05 02:50 PM
automatically insert system time in a cell PM Excel Discussion (Misc queries) 2 December 30th 04 04:56 PM
How do I write a macro for... Christopher Anderson Excel Discussion (Misc queries) 1 December 20th 04 05:18 PM
Date and Time Macro m.j.anderson Excel Discussion (Misc queries) 1 December 1st 04 12:35 AM


All times are GMT +1. The time now is 11:43 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"