Home |
Search |
Today's Posts |
#1
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
How do I copy data from a cell in one file to another? | New Users to Excel | |||
Combined date time cell to separate date & time components | Excel Discussion (Misc queries) | |||
Combined date time cell to separate date & time components | Excel Discussion (Misc queries) | |||
Combined date time cell to separate date & time components | Excel Discussion (Misc queries) | |||
store file saved date in cell | Excel Worksheet Functions |