View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Frank Kabel Frank Kabel is offline
external usenet poster
 
Posts: 3,885
Default 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/