I would like to have a counter on my excel sheet that will change each time a page is printed( I hit print with the number 1 in a1, the next time I hit print I would like the number to change to 2....) I have head this can be done but do not know enough to write code myself.If anyone can help me with a basic cut and paste code it would save me a ton of time and headache in tracking thies documents after they have been printed.
Thanks for your help!!!
BRKOH
Hi,
If you go into your visual basic editor and double click on ThisWorkbook and paste the following code, the value in cell A1 will be increased by 1 each time the user clicks print.However, this will increment regardless of whether the print succeeded or the user cancelled, but should give you a start.Private Sub Workbook_BeforePrint(Cancel As Boolean) Sheets(1).Range("A1").Value = CLng(Sheets(1).Range("A1").Value) + 1 End Sub
Thanks,
Dom
just a note:
you can press "Alt" and "F11" together to enter the VBA editor
Life is like a roll of toilet paper. The closer it gets to the end, the faster it goes.
John Wright
is there a way in the previous question to save it to a spacific file every time it prints?
That is perfect thank you all for your help! Did exactly what I was hoping for!!!
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks