Before print increment counter

  • Thread starter Thread starter webfort
  • Start date Start date
W

webfort

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
 
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
 
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top