VBA Printing and Page Breaks

HappyCamper

New Member
Joined
Nov 15, 2005
Messages
3
I'm having a tough time figuring out a way to solve this problem. This is what I have so far:

With ActiveSheet.PageSetup
.PrintTitleRows = "$1:$3"
.PrintTitleColumns = ""
.FitToPagesTall = 400
.FitToPagesWide = 1
.Zoom = False
End With
ActiveSheet.PageSetup.PrintArea = Range("a4:ew" & [a405].End(xlUp).Row).Address
Orientation = xlLandscape

What I have is a varible length spreadsheet that only needs to print data that is filled in. The width varies by users, but I only want it to print one page wide and always on legal paper. Also the rows need to be grouped by two. Basically what happens is that if someone has a different sized column the page break will automatically split one of the rows that is grouped by two. Other times it is not. I was trying to determine the page breaks set up by the above code and if it falls below an even row to move the page break up by one row. Any help would help me save the rest of my hair.
 

Excel Facts

How can you automate Excel?
Press Alt+F11 from Windows Excel to open the Visual Basic for Applications (VBA) editor.

Forum statistics

Threads
1,203,502
Messages
6,055,772
Members
444,822
Latest member
Hombre

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