Hi, can I increment a number in a cell every time that page is printed? (it's just a 1 page sheet)
Thanks
Hi, can I increment a number in a cell every time that page is printed? (it's just a 1 page sheet)
Thanks
Hi, something like this...
![]()
Sub ShowPrintCopies() 'Print active sheet ActiveSheet.PrintOut 'If cell is empty then enter 0 If Range("A2").Value = "" Then Range("A2").Value = 0 End If 'Increment copies value Range("A2").Value = Range("A2").Value + 1 End Sub
Thanks Nu2Java, looks good, very much appreciate your help, will try this when I get back into work
I wasn't sure if you are printing from the menu in the worksheet or printing from code. If you are printing from the menu in the worksheet then you can place this in "ThisWorkbook"
![]()
Private Sub Workbook_BeforePrint(Cancel As Boolean) 'If cell is empty then enter 0 If Range("A1").Value = "" Then Range("A1").Value = 0 End If 'Increment copies value Range("A1").Value = Range("A1").Value + 1 End Sub
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks