You could add code to the workbook_open event, thus (to add this open the
VBE (Alt+F11) and right click on the ThisWorkbook entry for the file name.
Paste the code in the resultant window, close the VBE and save the workbook.
(Change the references accordingly)
Private Sub Workbook_Open()
Worksheets("Sheet1").Range("A1").Value =
Worksheets("Sheet1").Range("A1").Value + 1
End Sub
--
HTH
Nick Hodge
Microsoft MVP - Excel
Southampton, England
(e-mail address removed)
You could add code to the workbook_open event, thus (to add this open the
VBE (Alt+F11) and right click on the ThisWorkbook entry for the file name.
Paste the code in the resultant window, close the VBE and save the workbook.
(Change the references accordingly)
Private Sub Workbook_Open()
Worksheets("Sheet1").Range("A1").Value =
Worksheets("Sheet1").Range("A1").Value + 1
End Sub
I think I did as shown exept changed "A1"s to "J5"s (the cell that I
would like to have the invoice # in). changed security to accept the
macro but get a syntax error with the value= line highlited
thanks again
Scott
The codes given by Nick works fine if you use it the first
time. But if you do intend to save the invoice and open it
later. The invoice no. will increase as well.
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.