View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Gary''s Student Gary''s Student is offline
external usenet poster
 
Posts: 11,058
Default Is there a way to automatically advance a number when printing?

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.
--
Gary's Student


"Brian Smith" wrote:

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