Invoice Numbering

G

Guest

How can I set up automatic sequential invoice numbering across multiple
worksheets but in the same workbood? I have all my customers set up on
individual worksheets and would like to assign an invoice number when I
print. Then would like the next time I print possibly a different worksheet
to print the next number up from the previous number that was assigned to the
last invoice.
 
J

JE McGimpsey

It will if you use the Workbook_BeforePrint event. For example:

Private Sub Workbook_BeforePrint(Cancel As Boolean)
Dim ws As Worksheet
Cancel = True
Application.EnableEvents = False
For Each ws In ActiveWindow.SelectedSheets
ws.Range("B1").Value = NextSeqNum
ws.PrintOut
Next ws
Application.EnableEvents = True
End Sub
 
G

Guest

OK, I'm not sure what is going on.....I would like to start at a value of 1
and then get the next sequential number to print in cell G3 across all
worksheets. Value to change only when an invoice is printed. But right now
with the number 1 starting in G3 and when I hit print...the value is deleted
in that worksheet only and it prints nothing. Actually its deleting any
value in that cell. Where do I put the starting number in the VBE. I'm
fairly new to this area of excel..and I only have myself to teach me..Thanks
for any help you can provide me. Or if you could provide me with the exact
macro I should insert that would be great. Thanks again
 

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