ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   Is there a way to automatically advance a number when printing? (https://www.excelbanter.com/excel-worksheet-functions/119870-there-way-automatically-advance-number-when-printing.html)

Brian Smith

Is there a way to automatically advance a number when printing?
 
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

Gary''s Student

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



All times are GMT +1. The time now is 07:06 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com