Article ID: 118589
Article Last Modified on 6/11/2007
Sub Check_PageBreak()
Dim i As Integer, BreakType As Integer
' To check for a vertical pagebreak, use the EntireColumn property.
BreakType = ActiveCell.EntireRow.PageBreak
If BreakType = xlAutomatic Then
' Enter the code that you want to run if the current row
' contains an automatic page break.
MsgBox "There is an automatic page break above this row"
ElseIf BreakType = xlManual Then
' Enter the code that you want to run if the current row
' contains a manual page break.
MsgBox "There is a manual page break above this row"
Else
' Enter the code that you want to run if the current row
' does not contain a page break.
MsgBox "There is no page break above this row"
End If
End Sub
Sub CheckForPageBreaks()
Dim i As Integer
For i = 1 to ActiveSheet.UsedRange.Rows.Count
If Rows(i).PageBreak = xlManual then
MsgBox "There is a manual page break above row " & i
ElseIf Rows(i).PageBreak = xlAutomatic Then
MsgBox "There is an automatic page break above row " & i
End If
Next
End Sub
PageBreak
Additional query words: 5.00a 5.00c 97 XL97 98 XL98 XL7 XL5 GET.CELL(27) XL
Keywords: kbdtacode kbhowto kbprogramming KB118589