View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
slorryy
 
Posts: n/a
Default Need a formula to create an order number


Richard Buttrey Wrote:
On Fri, 5 May 2006 17:56:40 -0500, slorryy
wrote:


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


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


--
slorryy
------------------------------------------------------------------------
slorryy's Profile: http://www.excelforum.com/member.php...o&userid=34183
View this thread: http://www.excelforum.com/showthread...hreadid=539451