View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.misc
cxlough41
 
Posts: n/a
Default 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