Need a formula to create an order number

S

slorryy

Hi People

I am trying to deign a form and excel.

I need a function to auto create a order number (basically a
function/formula that add 1 onto the previous order number when a new
order is created)

Hope that makes sence

Any help would be fab

Mark
 
G

Gord Dibben

Mark

Have a look at John McGimpsey's VBA method.

http://www.mcgimpsey.com/excel/sequentialnums.html


Gord Dibben MS Excel MVP

Hi People

I am trying to deign a form and excel.

I need a function to auto create a order number (basically a
function/formula that add 1 onto the previous order number when a new
order is created)

Hope that makes sence

Any help would be fab

Mark

Gord Dibben MS Excel MVP
 
S

slorryy

Richard said:
Perhaps the simplest way is to hold the current order number as a
variable in a cell. Then with the event that triggers a new order, add
a line of code that increases the order number variable by 1.

So suppose your order numbers are are of the form ON1234, ON1235 etc,
where there is a prefix "ON" to a sequential number, and the variable
cell is named say "Onumber"

add a line of code

Range("Onumber")= "ON" & Right(Range("Onumber"), Len(Range("Onumber"))
- 2) + 1


HTH
__
Richard Buttrey
Grappenhall, Cheshire, UK
__________________________

Hi Richard, Sounds like that will work.

But the only thing i cant work out is what event will trigger the new
order. I was hopeing the new order number would be triggered when the
file is opened. can you think of another way to do it?

The file i am working on is here if you wish to have a look
http://www.slorryy.com/tekbo.xls

Thanks
 
S

slorryy

Hi Richard

Thanks for your help regarding this subject, I have decided to just
enter the numbers manually as I am not educated inVB.

Cheers for your time.
 
Top