ExcelBanter

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

Trevor Shuttleworth

Count number of prints.
 
Luis

not sure if I've understood you properly. The routine that follows is
slightly modified from the VB Help for VPageBreaks and HPageBreaks

Sub CountPageBreaks()
Dim cFull As Long
Dim cPartial As Long

cFull = 0
cPartial = 0
For Each pb In Worksheets(1).VPageBreaks
If pb.Extent = xlPageBreakFull Then
cFull = cFull + 1
Else
cPartial = cPartial + 1
End If
Next
MsgBox cFull & " full-screen page breaks, " & cPartial & _
" print-area page breaks"
Range("I1").Value = cFull

cFull = 0
cPartial = 0
For Each pb In Worksheets(1).HPageBreaks
If pb.Extent = xlPageBreakFull Then
cFull = cFull + 1
Else
cPartial = cPartial + 1
End If
Next
MsgBox cFull & " full-screen page breaks, " & cPartial & _
" print-area page breaks"
Range("I2").Value = cFull

End Sub

Regards

Trevor


"Luis Miguel" wrote in message
...
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 08:33 AM.

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