Presently I have hardcoded the page break in vba, however, was curious if this could be done more flexibly as number of cols could grow or shrink in the future. The layout is gender by ethnicity and would like to avoid breaking between genders.
How it Should look
[tt]
Group1 Group2 | Group3
M F M F | M F
|
[/tt]
How it Looks before adjustment
[tt]
Group1 Group2 Gro|up3
M F M F M | F
|
[/tt]
Code Snippet currently using
Is there some logic that could find the default page breaks and then decide if the M's are on one page and the F's another, to adjust accordingly?
How it Should look
[tt]
Group1 Group2 | Group3
M F M F | M F
|
[/tt]
How it Looks before adjustment
[tt]
Group1 Group2 Gro|up3
M F M F M | F
|
[/tt]
Code Snippet currently using
Code:
ActiveWindow.View = xlPageBreakPreview
Set ActiveSheet.VPageBreaks(1).Location = Range("P1")
ActiveWindow.View = xlNormalView
Is there some logic that could find the default page breaks and then decide if the M's are on one page and the F's another, to adjust accordingly?