fit to one page

  • Thread starter Thread starter J.W. Aldridge
  • Start date Start date
J

J.W. Aldridge

Attempting to fit all data onto one page, with landscape orientation.
Possible error with line:
ActiveSheet.VPageBreaks(1).DragOff Direction:=xlToRight,
RegionIndex:=1

(Any sugestions?)

Sub Macro6()
Range("A1").Select
Range(Selection, Selection.End(xlDown)).Select
Range(Selection, Selection.End(xlToRight)).Select
ActiveSheet.PageSetup.PrintArea = ""
With ActiveSheet.PageSetup
.Orientation = xlLandscape
End With
ActiveWindow.View = xlPageBreakPreview
ActiveSheet.VPageBreaks(1).DragOff Direction:=xlToRight,
RegionIndex:=1
ActiveWindow.SmallScroll Down:=-30
Range("A2").Select
End Sub

Thanx
 
Try

Sub printareamacro()
With ActiveSheet.PageSetup
.PrintArea = Range("a1").CurrentRegion.Address
.Orientation = xlLandscape
.CenterHorizontally = True
.CenterVertically = True
.Zoom = False
.FitToPagesWide = 1
.FitToPagesTall = 1
End With
ActiveSheet.PrintPreview
End Sub
 
Back
Top