Excel VBA code-sequential numbering

Jegacats

Board Regular
Joined
Jul 30, 2002
Messages
136
Would someone please tell me a code I can use for sequential numbering ?
 

Excel Facts

Links? Where??
If Excel says you have links but you can't find them, go to Formulas, Name Manager. Look for old links to dead workbooks & delete.

Jegacats

Board Regular
Joined
Jul 30, 2002
Messages
136
I can't believe no one has a solution.
I know I'm not very clear on what I am looking for. I will try to give a more concrete example.

I have a template (My expense report)When I open it, I would like it to have the current expense report number.
Ex : If the last number I used was 10, I would like the next one I make to be 11.

Thanks for any suggestions.
 

zacemmel

Well-known Member
Joined
Apr 29, 2002
Messages
636
Private Sub Workbook_Open()
Range("a1").value=range("a1").value+1
End Sub
 

Jegacats

Board Regular
Joined
Jul 30, 2002
Messages
136
Thank you. This works fine.
I opened the template, copied the code,saved the template. I tested the template.
I did "file" new and there it was, the number changed . I filled out the form and saved it with a new name and as an .xls

The next time I did file new, the number did not change.. :(
 

Forum statistics

Threads
1,144,058
Messages
5,722,269
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