Invoicing #'s and templates

jody2

New Member
Joined
Sep 27, 2002
Messages
5
Is there a formula out there that will increase the invioce number everytime you open a template? With the following code the invoice number will only increace if I go to the saved as invoice. I need something that will allow me to save that invoice and when I back to the template incraese the number by one.
Range ("I2") . Value = Range(I12") . Value + 1 PLS HELP Jody
 

Excel Facts

Save Often
If you start asking yourself if now is a good time to save your Excel workbook, the answer is Yes
I was looking for this same solution. I did as described and it works fine when I run the script in the Visual Basic Editor, but when I close and open the file it does not work (add one to the invoice number.) Any suggestions?
 
Upvote 0
works for me!

did you:

a) change the "directory" to a sheet name appropriate for your workbook?
b) put the code in the thisworkbook area?

Paddy
 
Upvote 0
Paddy,
I went to the site you refered me to... IT WORKED! Thank you very much
Range("I2").Value=Range("I2").Value+ 1
ActiveWorksheet.Save
 
Upvote 0
Below is the code I have for the WorkSheet M&L Sheet and it doesn't work. The script works fine if I run it from the VB Editor but the invoice number does not increase ever time I open the file. Any help is appreciated.

Private Sub Workbook_Open()
Range("H4").Value = Range("H4").Value + 1
ActiveWorkbook.Save
End Sub
 
Upvote 0
This was my mistake, I was puting the code in the actually worksheet instead of the workbook. Thanks for everyones help!
 
Upvote 0

Forum statistics

Threads
1,214,926
Messages
6,122,306
Members
449,079
Latest member
juggernaut24

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top