#1   Report Post  
Posted to microsoft.public.excel.misc
Khangura
 
Posts: n/a
Default Date Function

I was wondering if we could set DATE & TIME on a worksheet (in a cell), which
would default to the present time. Once the work is complete and the
worksheet is saved, the DATE & TIME should be saved as well.

On review at a later time, the DATE & TIME should reflect the date and time
the worksheet was saved, and not the present time.

Any help would be greatly appreciated. THX.


  #2   Report Post  
Posted to microsoft.public.excel.misc
Bob Phillips
 
Posts: n/a
Default Date Function

One way

Option Explicit

Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As
Boolean)
Worksheets("Sheet1").Range("A1").Value = _
Format(Now, "dd mmm yyyy hh:mm:ss")
End Sub

'This is workbook event code.
'To input this code, right click on the Excel icon on the worksheet
'(or next to the File menu if you maximise your workbooks),
'select View Code from the menu, and paste the code


--
HTH

Bob Phillips

(remove nothere from email address if mailing direct)

"Khangura" wrote in message
...
I was wondering if we could set DATE & TIME on a worksheet (in a cell),

which
would default to the present time. Once the work is complete and the
worksheet is saved, the DATE & TIME should be saved as well.

On review at a later time, the DATE & TIME should reflect the date and

time
the worksheet was saved, and not the present time.

Any help would be greatly appreciated. THX.




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
date format and the RIGHT function Rich Hayes Excel Worksheet Functions 0 December 19th 05 11:06 AM
NETWORKDAYS - Multiple Date Selection Annabelle Excel Discussion (Misc queries) 3 October 4th 05 07:04 PM
Date function Dee Excel Worksheet Functions 2 July 13th 05 03:32 PM
Excel date function Excel date range function Excel Worksheet Functions 6 June 15th 05 01:59 PM
Is there a function to show future date taxmom Excel Worksheet Functions 2 March 4th 05 09:23 PM


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