Increasing invoice number

  • Thread starter Thread starter Kevin M
  • Start date Start date
K

Kevin M

Hey all,

I've been trying to think of a way to create a unique
invoice number on a worksheet, say , every time it is
printed, or saved maybe.. I'm assuming that i'd have to
have some VB in place, but for all my excel knowledge, my
VB is not up to par. Any insights?

Thanks folks!

Kevin M.
 
Good evening Kevin -


The following information would allow you to get what you want:
In the personal macro workbook:
Sheet1 - cell A1 enter the number you want your invoices to start with
For example: 100000

Using the VBA editor insert the following code:
Sub INV_NUM()
x = Thisworkbook.Sheets(1).Range("A1").Value
' Gets the value for the Invoice
ActiveSheet.Range("C5").value = x
' C5 is the cell where you want the Invoice number in the invoice sheet
Thisworkbook.Sheets(1).Range("A1").Value = x + 1
'Increases the invoice by 1 for the next invoice
End Sub

Save the Personal Macro Workbook

If you activate an Invoice sheet and run the macro - the number 100000 will be placed in cell C5 of the active sheet.
The next time you run the macro 100001 will be placed in the cell C5 of the active sheet.
You can assign a short cut key to it and run it anytime you wish.


Hopes this makes sense.
If you need further help - let me know - I will be glad to help.

Thanks,
Jon Barchenger
 
Back
Top