Sequential Numbers

SteelRail

New Member
Joined
Oct 29, 2002
Messages
30
I am trying to insert a macro or VB to keep track of numbering in a template. I have the following:

sub inc()
range("a1").value=range("a1").value+1
end sub

It works for numbering but I would like it to keep track of the last number assigned so when it runs again, it inserts the next sequential number. Any clue?
 

Excel Facts

Return population for a City
If you have a list of cities in A2:A100, use Data, Geography. Then =A2.Population and copy down.
I don't know what you mean by "keep track", but you might consider a hidden sheet in your template that has a list of numbers used, or a list of numbers to be used.

HTH
 
Upvote 0
Open Excel; Go to FILE-New and click the tab that says "spreadsheet solutions" and open INVOICE. A toolbar opens with the template and within the toolbar is a button that when pushed, displays a message and permenently assigns a number to the cell to the right of "po number".

How is this done? Anyone, please help!
 
Upvote 0
If you assign your macro to button you will have the same result.You need to save your invoice as a template. If your Invoice number is in A1 it will increase by 1 each time the button is clicked. The number will be remembered each time you save your invoice.
This message was edited by royUK on 2002-11-04 02:35
 
Upvote 0

Forum statistics

Threads
1,213,543
Messages
6,114,240
Members
448,555
Latest member
RobertJones1986

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