Assigning a Unique number

M

Michael

I would like to create a macro that would assign a unique sequential number and assign this task to an icon.

Example: I have a worksheet used as a master to create individual purchase orders with each one assigned a unique number, and I need each one to have the next higher number from the previous one created. How can I do this?

Thank you
 
P

Paul D

What exactly do you mean by icon?
are you referring to sequential numbering on the tab names (i.e worksheets)
or actual file names (i.e. workbooks) or something else?
Paul

Michael said:
I would like to create a macro that would assign a unique sequential
number and assign this task to an icon.
Example: I have a worksheet used as a master to create individual purchase
orders with each one assigned a unique number, and I need each one to have
the next higher number from the previous one created. How can I do this?
 
R

reesmacleod

I am assuming that you mean a toolbar button when you say "Icon". S
what you want is a button that you press that will give you the nex
available number, yes?

If so you could simply make a seperate workbook called "Invoice Number
that has one sheet only and in that sheet you have a "Current Number
cell and a "Last Number" cell. You would then make a macro that open
the Invoice Number workbook, grabs the Current Number, puts it in th
Last Number cell, then adds 1 to the Current Number, pastes that valu
in your workbook that is open and waiting for that number, the
replaces the Current Number in the Invoice Number workbook, saves i
and closes it.

After you make that macro, you would assign it to a toolbar button.

Just one idea, anyway

Rees Macleo
 
M

Michael of Hanson

Yes that was right, I want to assign the function to a toolbar button. Thank you for you thought. I will try that.
 
Top