ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Assigning a Unique number (https://www.excelbanter.com/excel-programming/284340-assigning-unique-number.html)

Michael[_20_]

Assigning a Unique number
 
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

Paul D[_2_]

Assigning a Unique number
 
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" wrote in message
...
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




reesmacleod[_5_]

Assigning a Unique number
 

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

-----------------------------------------------
~~ Message posted from http://www.ExcelTip.com
~~View and post usenet messages directly from http://www.ExcelForum.com

~~Now Available: Financial Statements.xls, a step by step guide to creating financial statements

Michael of Hanson

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


All times are GMT +1. The time now is 12:33 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com