Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.misc
|
|||
|
|||
Insert Automatic, Non-Updating Date Stamp
I use an Excel invoice to bill clients.
Currently I have an Invoice Date field which is populated by the =TODAY() function. That's good. However, if I open the spreadsheet down the road and accidentally recalculate, the Invoice Date field is updated with the current date. That's not so good. Is there a simple macro I can use that Inserts the date when the document is created and then terminates? Something, I guess, that calls the TODAY() function and then pops the resulting date value into the appropriate cell. I know I can just use CTRL+; to insert the date manually but I'm shooting for *fewer* things that I can potentially forget when invoicing. Thanks, KZ |
#2
Posted to microsoft.public.excel.misc
|
|||
|
|||
Insert Automatic, Non-Updating Date Stamp
One way:
Put this in your ThisWorkbook code module. Change "A1" to whatever cell you want the date to be entered in, and modify the date format to suit: Private Sub Workbook_Open() With Sheets(1).Range("A1") If IsEmpty(.Value) Then .NumberFormat = "dd mmmm yyyy" .Value = Date End If End With End Sub Save your template with A1 cleared. In article . com, "Ken Zenachon" wrote: I use an Excel invoice to bill clients. Currently I have an Invoice Date field which is populated by the =TODAY() function. That's good. However, if I open the spreadsheet down the road and accidentally recalculate, the Invoice Date field is updated with the current date. That's not so good. Is there a simple macro I can use that Inserts the date when the document is created and then terminates? Something, I guess, that calls the TODAY() function and then pops the resulting date value into the appropriate cell. I know I can just use CTRL+; to insert the date manually but I'm shooting for *fewer* things that I can potentially forget when invoicing. Thanks, KZ |
#3
Posted to microsoft.public.excel.misc
|
|||
|
|||
Insert Automatic, Non-Updating Date Stamp
Thanks, I'll try that and get back to you.
KZ |
#4
Posted to microsoft.public.excel.misc
|
|||
|
|||
Insert Automatic, Non-Updating Date Stamp
JE,
i tried this code in excel 03 on xp and it does not work.... well it must coming from you but i am not seeing it happen...lol...i think it is me. I have a workbook that has a customer info sheet which creates a 1-of-a-kind number based on the customers first and last names and the date customer calls for service. Right now i must manualy enter the date so the customer number can be generated. can you help.... this is the basic look of the sheet My Co. Name DATE __________________________________________ last name Customer No. first name __________________________________________ Cust. Address Street City St. Zip DATE = Cell I1:J1 this is the cell which needs the auto date (date format should be mmddyy with no puctuation)... this date can not however be volitile or the customer number will change and that would be bad...lol another thing i am having bad luck with is - i need to "auto save as" the workbook b4 closeing .... i would like to have the workbook saved using the generated customer number as the file name the CUSTOMER NO. cell = I10:J10 i honestly do not know if the code windows are ready for me cause i never used them b4...just found out that they were there yesterday...lol anthing you can do to help would be great! "JE McGimpsey" wrote: One way: Put this in your ThisWorkbook code module. Change "A1" to whatever cell you want the date to be entered in, and modify the date format to suit: Private Sub Workbook_Open() With Sheets(1).Range("A1") If IsEmpty(.Value) Then .NumberFormat = "dd mmmm yyyy" .Value = Date End If End With End Sub Save your template with A1 cleared. In article . com, "Ken Zenachon" wrote: I use an Excel invoice to bill clients. Currently I have an Invoice Date field which is populated by the =TODAY() function. That's good. However, if I open the spreadsheet down the road and accidentally recalculate, the Invoice Date field is updated with the current date. That's not so good. Is there a simple macro I can use that Inserts the date when the document is created and then terminates? Something, I guess, that calls the TODAY() function and then pops the resulting date value into the appropriate cell. I know I can just use CTRL+; to insert the date manually but I'm shooting for *fewer* things that I can potentially forget when invoicing. Thanks, KZ |
#5
Posted to microsoft.public.excel.misc
|
|||
|
|||
Insert Automatic, Non-Updating Date Stamp
Well, I did as you said but it doesn't seem to work.
Am I supposed to save the worksheet as an XLT template or should just opening the XLS file with the code in the ThisWorkbook module do the trick? KZ |
#6
Posted to microsoft.public.excel.misc
|
|||
|
|||
Insert Automatic, Non-Updating Date Stamp
Since you don't say what "doesn't seem to work" means, it's hard to
tell. Is nothing happening? the wrong value being entered? The code should be entered in the ThisWorkbook module of the XLT. The XLT should have the target cell blank when saved. In article . com, "Ken Zenachon" wrote: Well, I did as you said but it doesn't seem to work. Am I supposed to save the worksheet as an XLT template or should just opening the XLS file with the code in the ThisWorkbook module do the trick? |
#7
Posted to microsoft.public.excel.misc
|
|||
|
|||
Insert Automatic, Non-Updating Date Stamp
Insert the current date and time in a cell Select a cell and press CTRL+; -- rsenn ------------------------------------------------------------------------ rsenn's Profile: http://www.excelforum.com/member.php...o&userid=29050 View this thread: http://www.excelforum.com/showthread...hreadid=495570 |
#8
Posted to microsoft.public.excel.misc
|
|||
|
|||
Insert Automatic, Non-Updating Date Stamp
Sorry, my answer was a bit vague...
When I first enteredthe formula into my XLS (not XLT) nothing happened immediately, and nothing happened when I closed and reopened the document. I'm going to save it as a template and get back to you. KZ |
#9
Posted to microsoft.public.excel.misc
|
|||
|
|||
Insert Automatic, Non-Updating Date Stamp
Hey, it works!
:) Thanks very much. KZ |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Date stamp formula results? Tricky problem? | Excel Discussion (Misc queries) | |||
insert the last date when the file was modifie | Excel Discussion (Misc queries) | |||
Excel 2003: can I insert a "last edited" date function? | Excel Worksheet Functions | |||
Automatic updating of Conditional Formats using dates | Excel Worksheet Functions | |||
How do I stop today() from updating date on saved spreadsheets? | Excel Discussion (Misc queries) |