View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming,microsoft.public.excel.worksheet.functions
Eddy[_3_] Eddy[_3_] is offline
external usenet poster
 
Posts: 15
Default Count number of prints.

Supposed you want keep track of the number of printing of the sheet
"Sheet2", put the following codes into the ThisWorkbook module:-

Private Sub Workbook_BeforePrint(Cancel As Boolean)
Dim Wkt As Worksheet
Dim n As Integer
Set Wkt = Worksheets("Sheet1")
If ActiveSheet.Name = "Sheet2" Then
n = IIf(Wkt.Range("A1").Value = "", 0, Wkt.Range("A1").Value)
Wkt.Range("A1").Value = n + 1
End If
Set Wkt = Nothing
End Sub

Unfortunately, these codes do not detect the number of copied being printed.
Could someone tell us if there is a printcopy property in Excel.


"Luis Miguel" ¼¶¼g©ó¶l¥ó
...
Hello,

I want to know if is possible to put, in a cell, a counter of number of
prints in a sheet or xls file.

Thanks in advance,
Luis Miguel.