ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Count number of prints. (https://www.excelbanter.com/excel-programming/271025-re-count-number-prints.html)

Eddy[_3_]

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.








All times are GMT +1. The time now is 06:37 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com