Is there a way to automatically advance a number when printing?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I am designing a shipping tag for one of my customers and I need to know if
there is a way to automatically advance a number everytime I click the print
button. This would make it easier than typing a number one at a time for
about a hundred shipping tags.

Any help would be greatly appreciated.

Thank,

Brian
 
Put this macro in ThisWorkbook code area:

Private Sub Workbook_BeforePrint(Cancel As Boolean)
Dim ws As Worksheet
If ActiveSheet.Name = "Sheet1" Then
Range("A1").Value = Range("A1").Value + 1
End If
End Sub

Using A1 as an example, it is incremented just before the sheet is printed.
 

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

Back
Top