Count number of manual and automatic vertical page breaks - examples

D

DataFreakFromUtah

no question here, just a couple of procedures for the archive.


search criteria: count the number of manual and automatic page breaks
in
worksheet. Get the total number of VPageBreaks in worksheet.
VPageBreaks.Count

Sub PageBreaksVCountM()
'Counts the number of manual vertical page breaks on the
'active worksheet.

Dim VPB As VPageBreak
Dim N As Long
For Each VPB In ActiveSheet.VPageBreaks
If VPB.Type = xlPageBreakManual Then
N = N + 1
End If
Next VPB
MsgBox "There are " & N & " manual vertical page breaks on this
worksheet"
End Sub



Sub PageBreaksVCountMA()
'Counts the number of vertical manual & auto page breaks on the
'active worksheet.
Dim VBreaksCount As Integer
VBreaksCount = ActiveSheet.VPageBreaks.Count
MsgBox "There are " & VBreaksCount & " manual and automatic
vertical page breaks on this sheet"
End Sub
 

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

Top