sequential number generator

K

Karen Westerman

Hello,

I have created an invoice form and wish to be able to
click a button and have Excel generate the next invoice
number in a series. Suggestions?

Thanks,

Karen
 
N

Nick Hodge

Karen

You could simply put the following code in the CommandButton Click event

Private Sub CommandButton1_Click()
Worksheets("Sheet1").Range("A1").Value =
Worksheets("Sheet1").Range("A1").Value + 1
End Sub


Change the references as necessary

--
HTH
Nick Hodge
Microsoft MVP - Excel
Southampton, England
(e-mail address removed)
 
J

Jan Karel Pieterse

Hi,

You will need a place that is going to keep the last
number used somewhere.

If this number is to be available to mulitiple users,
consider using a textfile on a network drive.

You will have to write some VBA code to get and update the
number, taking into consideration that more than one user
might try to get a number at the same moment.

Regards,

Jan Karel Pieterse
Excel TA/MVP
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top