Page breaks auto vs manual

Daniel.Ro

Board Regular
Joined
Aug 24, 2008
Messages
60
Hi there

Is there any way to determine what type of pagebreak are set on a worksheet?
I have a worksheet with some manual page breaks and some auto pagebreaks set by excel
I want to determine the location of the auto pagebreaks set by excel and move them but so far I'm not able to determin which one is auto and which manual set. Help :)
 

Excel Facts

Workdays for a market open Mon, Wed, Friday?
Yes! Use "0101011" for the weekend argument in NETWORKDAYS.INTL or WORKDAY.INTL. The 7 digits start on Monday. 1 means it is a weekend.
Hi

For Horizontal Page Breaks try :-
Code:
X = ActiveSheet.HPageBreaks(1).Location.Row
If Rows(X).PageBreak = xlPageBreakAutomatic Then

For Vertical Page Breaks try :-
Code:
 X = ActiveSheet.VPageBreaks(1).Location.Column
If Columns(X).PageBreak = xlPageBreakAutomatic Then

change the 1 in brackets to the number of the Page Break you are testing.

The number of Page Breaks on a Page is determined by ActiveSheet.VPageBreaks.Count and ActiveSheet.HPageBreaks.Count respectively.

NB If you move or insert Page Break locations then the number of Page Breaks may change.

hth
 
Last edited:
Upvote 0
Thank you Mike

I don't know how much breaks are in the page and where are located.

But I solved it like this:

Code:
For i = 1 To ActiveSheet.HPageBreaks.Count    With ActiveSheet.HPageBreaks
        If ActiveSheet.Rows(.Item(i).Location.Row).PageBreak = xlAutomatic Then
MsgBox .Item(i).Location.Row
 
Upvote 0

Forum statistics

Threads
1,224,827
Messages
6,181,199
Members
453,022
Latest member
RobertV1609

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top