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

Formula for Yesterday
Name Manager, New Name. Yesterday =TODAY()-1. OK. Then, use =YESTERDAY in any cell. Tomorrow could be =TODAY()+1.

imported_unknown

Active Member
Joined
Jan 13, 2002
Messages
424
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?
 

PaddyD

MrExcel MVP
Joined
May 1, 2002
Messages
14,234
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
 

jody2

New Member
Joined
Sep 27, 2002
Messages
5

ADVERTISEMENT

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
 

imported_unknown

Active Member
Joined
Jan 13, 2002
Messages
424
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
 

imported_unknown

Active Member
Joined
Jan 13, 2002
Messages
424
This was my mistake, I was puting the code in the actually worksheet instead of the workbook. Thanks for everyones help!
 

Forum statistics

Threads
1,144,056
Messages
5,722,256
Members
422,419
Latest member
Havok390

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
Top