Setting Vertical Page Breaks

J

J.W. Aldridge

I asked this question earlier today, but may have scared people off
with how I worded the question. So, is there anyway to set the
vertical page break ranges after the print area has been established?

I would like set the page break at n51, n91, n131, etc.


Sub SetPrtAr_mysheet()
Dim lLastRow As Long
lLastRow = Range("I65536:K65536").End(xlUp).Row
Orientation = xlLandscape
ActiveSheet.PageSetup.PrintArea = Range("a6:N" & lLastRow).Address
End Sub


Thanx
 
J

JLGWhiz

Here is the syntax to add the vertical page breaks. I have not used this,
so I don't know what this does to the automatic page breaks that are set in
the PageSetup exercise. You probably should test this a little before trying
to implement it in full code.

ActiveSheet.VPageBreaks.Add Before:=ActiveCell

Substitute a Range reference for ActiveCell. It looks like you might have
to do it more than once or loop with an array to do what you described.
Anyhow, you can play with it.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top