Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Nello
 
Posts: n/a
Default Automatic Populate Todays Date in Cell when File is Saved.

I am creating a user data entry spreadsheet in excel and I want to record the
date in a specific field when the excel file is opened. I need the field
"Submit Date" to be automatically populated and protected when a user opens
the file and performs a save. If the user does not Save the file the date
field should remain empty. Can anyone help with this please?
  #2   Report Post  
Otto Moehrbach
 
Posts: n/a
Default

Paste the following macro into the Workbook module. You access the Workbook
module by right-clicking on the Excel icon to the left of the word "File" in
the menu across the top of the spreadsheet, select View Code.
This macro will put the data in A1 if the user commands a save. If you
want the date and time, change the "Date" to "Now". Is this what you want?
HTH Otto
"Nello" wrote in message
...
I am creating a user data entry spreadsheet in excel and I want to record
the
date in a specific field when the excel file is opened. I need the field
"Submit Date" to be automatically populated and protected when a user
opens
the file and performs a save. If the user does not Save the file the date
field should remain empty. Can anyone help with this please?



  #3   Report Post  
Nello
 
Posts: n/a
Default

Hi Otto

I do not see any code. Can you please resend?

"Otto Moehrbach" wrote:

Paste the following macro into the Workbook module. You access the Workbook
module by right-clicking on the Excel icon to the left of the word "File" in
the menu across the top of the spreadsheet, select View Code.
This macro will put the data in A1 if the user commands a save. If you
want the date and time, change the "Date" to "Now". Is this what you want?
HTH Otto
"Nello" wrote in message
...
I am creating a user data entry spreadsheet in excel and I want to record
the
date in a specific field when the excel file is opened. I need the field
"Submit Date" to be automatically populated and protected when a user
opens
the file and performs a save. If the user does not Save the file the date
field should remain empty. Can anyone help with this please?




  #4   Report Post  
Otto Moehrbach
 
Posts: n/a
Default

Oops! I forgot to send the code. I redid it after reading your last
message. This code consists of 2 macros. The Open macro puts the date into
a cell named SubmitDate when the file is opened.
The second macro may or may not be necessary but it removes the date if the
file is closed without first being saved. Let me know if this works for
you. Otto
Private Sub Workbook_Open()
Range("SubmitDate") = Date
End Sub

Private Sub Workbook_BeforeClose(Cancel As Boolean)
If ThisWorkbook.Saved = False Then _
Range("SubmitDate").ClearContents
End Sub

"Nello" wrote in message
...
Hi Otto

I do not see any code. Can you please resend?

"Otto Moehrbach" wrote:

Paste the following macro into the Workbook module. You access the
Workbook
module by right-clicking on the Excel icon to the left of the word "File"
in
the menu across the top of the spreadsheet, select View Code.
This macro will put the data in A1 if the user commands a save. If
you
want the date and time, change the "Date" to "Now". Is this what you
want?
HTH Otto
"Nello" wrote in message
...
I am creating a user data entry spreadsheet in excel and I want to
record
the
date in a specific field when the excel file is opened. I need the
field
"Submit Date" to be automatically populated and protected when a user
opens
the file and performs a save. If the user does not Save the file the
date
field should remain empty. Can anyone help with this please?






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 copy data from a cell in one file to another? acraig New Users to Excel 1 February 15th 05 03:09 PM
Combined date time cell to separate date & time components Mark Ada Excel Discussion (Misc queries) 1 December 2nd 04 02:48 AM
Combined date time cell to separate date & time components Mark Ada Excel Discussion (Misc queries) 1 December 2nd 04 12:07 AM
Combined date time cell to separate date & time components Mark Ada Excel Discussion (Misc queries) 1 December 2nd 04 12:07 AM
store file saved date in cell Martin Connelly Excel Worksheet Functions 1 November 16th 04 01:32 PM


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