sequential number generator

  • Thread starter Thread starter Karen Westerman
  • Start date Start date
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
 
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)
 
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
 
Back
Top