View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
DataFreakFromUtah DataFreakFromUtah is offline
external usenet poster
 
Posts: 36
Default Count number of manual and automatic vertical page breaks - examples

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