Hope someone can help me

J

Jay Blatherwick

Hi

I have created what I thought was a template of an invoice - hoping
other people could use it, putting in their amounts etc then save it
but the template wouldn't change for next time but I can still save new
stuff to the template.

I also want the time to update automatically on the template but not
when it is saved by someone - I then want the date to stay on that date
it was saved so we have a record of all the invoices we create but still
also have the template intact.

Hope someon can help me and sorry if I have not made myself too clear.

Jay
 
B

Bob Phillips

You need to add some VBA to the template


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

(replace xxxx in the email address with gmail if mailing direct)

"Jay Blatherwick"
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top