Hi,
I have put together the following Print Setup VBA code behind a command button, but I can't get it to work properly:
Sub Print_Report()
Application.ScreenUpdating = False
With Worksheets("Rates").PageSetup
.DisplayPageBreaks = False
.PrintTitleRows = "A9:LastColumn"
.LeftMargin = Application.InchesToPoints(0.3)
.RightMargin = Application.InchesToPoints(0.3)
.TopMargin = Application.InchesToPoints(0.75)
.BottomMargin = Application.InchesToPoints(0.75)
.HeaderMargin = Application.InchesToPoints(0.3)
.FooterMargin = Application.InchesToPoints(0.3)
.CenterHorizontally = True
.Orientation = xlPortrait
.FirstPageNumber = xlAutomatic
.FitToPagesWide = 1
.FitToPagesTall = 1
End With
Application.ScreenUpdating = True
Selection.PrintOut Copies:=1, Collate:=True
End Sub
I need to fix some of the code to incorporate the following rules:
I want the Macro to:
1: Include data in report from cells A5 to last column/last row
2. Print column titles on every page (Columns titles are now found on Row 9 starting from A9 to last column)
3. Autofit Columns to best Width
4. Scale Worksheet to fit all columns on One Page
Bookmarks