Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Count the number of just the horizontal manual page breaks
Win 2000
Excel 2000 Hello, I am trying to find a way to count just the number of manual horizontal page breaks in the active worksheet. The count should not include the number of automatic horizontal page breaks. I have a procedure below that gives me both (manual & automatic), but I can't find a way to isolate for just the manual count. I need to incorporate xlPageBreakManual into the procedure I think, but I'm sure how to do this. I would appreciate any help that could be provided. Thank you so much. Tom Sub PageBreaksHCount() 'Counts the number of horiztonal page breaks (both manual & automatic) 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 |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Count the number of just the horizontal manual page breaks
Try something like the following:
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" -- Cordially, Chip Pearson Microsoft MVP - Excel Pearson Software Consulting, LLC www.cpearson.com "DataFreakFromUtah" wrote in message om... Win 2000 Excel 2000 Hello, I am trying to find a way to count just the number of manual horizontal page breaks in the active worksheet. The count should not include the number of automatic horizontal page breaks. I have a procedure below that gives me both (manual & automatic), but I can't find a way to isolate for just the manual count. I need to incorporate xlPageBreakManual into the procedure I think, but I'm sure how to do this. I would appreciate any help that could be provided. Thank you so much. Tom Sub PageBreaksHCount() 'Counts the number of horiztonal page breaks (both manual & automatic) 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 | |||
1026 horizontal page breaks? | Excel Discussion (Misc queries) | |||
"manual page breaks error" | Excel Worksheet Functions | |||
Dealing with automatic / manual page breaks | Excel Discussion (Misc queries) | |||
horizontal page breaks | Excel Discussion (Misc queries) | |||
Excel - turn a page number in a header from horizontal to vertical | Charts and Charting in Excel |