Page Breaks VBA, Excel 2000 & 2003

J

jfcby

Hello,

I'm tring to get this macro to move my pagebreak over to Column E but
it only brings up Page Preview and when I close it this part of the
VBA is high lighted:

ActiveSheet.VPageBreaks.DragOff Direction:=xlToRight, RegionIndex:=1

This is the full code:

Sub PageBreak()
ActiveWindow.SelectedSheets.PrintPreview
ActiveSheet.VPageBreaks.DragOff Direction:=xlToRight,
RegionIndex:=1
ActiveWindow.View = xlNormalView
End Sub

How can I get the above code to move my page break over to column e?

Thank you for your help,
jfcby
 
J

jfcby

Hello,

I'm tring to get this macro to move my pagebreak over to Column E but
it only brings up Page Preview and when I close it this part of the
VBA is high lighted:

ActiveSheet.VPageBreaks.DragOff Direction:=xlToRight, RegionIndex:=1

This is the full code:

Sub PageBreak()
ActiveWindow.SelectedSheets.PrintPreview
ActiveSheet.VPageBreaks.DragOff Direction:=xlToRight,
RegionIndex:=1
ActiveWindow.View = xlNormalView
End Sub

How can I get the above code to move my page break over to column e?

Thank you for your help,
jfcby

Hello,

Adding to this question:

Can the automatic page breaks be moved with vba?

Thank you for your help,
jfcby
 
J

jfcby

Hello,

Adding to this question:

Can the automatic page breaks be moved with vba?

Thank you for your help,
jfcby- Hide quoted text -

- Show quoted text -

Hello,

Problem solved with the help of a co-worker!

Solution:
Go File, Page setup, on the Page tab select Fit To One Page Wide and
make sure Tall is blank.

jfcby
 

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