![]() |
Before print increment counter
Hi, I was wondering if any one could help me. I have designed a
standard sheet, nothing fancy. This may be very easy for most of you and is my first time programming in Excel. What I want to do is before a page prints I want a number to incremen eg. If i want to print this form 50 times the number will increment from - 50 so I will then end up with 50 copies. I understand this could b done the long way by me cutting and pasting the sheet 50 times an inserting page breaks, but what I want to do is save it after, so whe I come back to print some more it will start from 51. If any one could help it would be much appreciated. Thank you for you time. Ashle -- Message posted from http://www.ExcelForum.com |
Before print increment counter
Hi
try the following VBA code (put it in your workbook module - not in a standard module). It will increment cell A1 on sheet1: Private Sub Workbook_BeforePrint(Cancel As Boolean) worksheets("Sheet1").Range("A1").value = _ worksheets("Sheet1").Range("A1").value + 1 End Sub -- Regards Frank Kabel Frankfurt, Germany Hi, I was wondering if any one could help me. I have designed a a standard sheet, nothing fancy. This may be very easy for most of you, and is my first time programming in Excel. What I want to do is before a page prints I want a number to increment eg. If i want to print this form 50 times the number will increment from 1 - 50 so I will then end up with 50 copies. I understand this could be done the long way by me cutting and pasting the sheet 50 times and inserting page breaks, but what I want to do is save it after, so when I come back to print some more it will start from 51. If any one could help it would be much appreciated. Thank you for you time. Ashley --- Message posted from http://www.ExcelForum.com/ |
Before print increment counter
Hi, have tried this, but does not seem to work, this is a screen sho
attached to this message. Also will this code work say if I go to prin and want 50 copies of the same worksheet, will is increment 50 times did try some code that did it if you go to print each time but did no increment the number to 50. Hope you can help more, and thank you for your quick reply. Ashle Attachment filename: screenshot.gif Download attachment: http://www.excelforum.com/attachment.php?postid=50244 -- Message posted from http://www.ExcelForum.com |
All times are GMT +1. The time now is 12:00 PM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com