To print a defined area, center horizontally, with 2 rows as titles, in portrait orientation and fitted to page wide and tall - 1 copy : Worksheet Print Setting « Excel « VBA / Excel / Access / Word






To print a defined area, center horizontally, with 2 rows as titles, in portrait orientation and fitted to page wide and tall - 1 copy

 
Sub PrintRpt3()
    With Worksheets("Sheet1").PageSetup
        .CenterHorizontally = True
        .PrintArea = "$A$3:$F$15"
        .PrintTitleRows = ("$A$1:$A$2")
        .Orientation = xlPortrait
        .FitToPagesWide = 1
        .FitToPagesTall = 1
    End With
    Worksheets("Sheet1").PrintOut
End Sub

 








Related examples in the same category

1.puts the filename in the right footer