Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Count number of HPageBreaks on worksheet - examples
No question here, just 1 function and 2 procedures for the archive.
Seach keywords/phrases: Count the number of manual and horizontal page breaks in a worksheet. Get the number of HPageBreaks in a worksheet. Function PageBreaksHrzCount(SheetName As String) As Long 'Counts the number of horizontal page breaks in target wsheet 'both manual and automatic PageBreaksHrzCount = Worksheets(SheetName).HPageBreaks.Count End Function Sub PageBreaksHCountM() 'Counts the number of manual horizontal page breaks on the 'active worksheet. Dim HPB As HPageBreak Dim N As Long For Each HPB In ActiveSheet.HPageBreaks If HPB.Type = xlPageBreakManual Then N = N + 1 End If Next HPB MsgBox "There are " & N & " manual page breaks on this worksheet" End Sub Sub PageBreaksHCountMA() 'Counts the number of horiztonal manual & auto page breaks on the 'active worksheet. Dim HBreaksCount As Integer HBreaksCount = ActiveSheet.HPageBreaks.Count MsgBox "There are " & HBreaksCount & " manual and automatic page breaks on this sheet" End Sub |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
how to count number of pages in worksheet | Excel Worksheet Functions | |||
how to count number of pages in worksheet | Excel Discussion (Misc queries) | |||
How can I count the number of ranges in a worksheet consolidation | Excel Worksheet Functions | |||
how do i count the number of times criteria appears in a worksheet | Excel Worksheet Functions | |||
Where are the examples from Help to copy to a blank worksheet? | Excel Discussion (Misc queries) |