Mega Code Archive

 
Categories / VisualBasic Script / Excel
 

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

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