I excel if I record a macro of doing this...
or do it manually (Select all sheets.. the pagesetup) it hits all the sheets.
In my VB app it doesnt hit anything but the first sheet!???
VB Code:
Private Sub PrintSetup() For X = 1 To WKBK.Worksheets.Count WKBK.Worksheets(X).Select Replace:=False Next WKBK.Worksheets(1).Activate With WKBK.ActiveSheet.PageSetup .PrintTitleRows = HeadRow '"$3:$12" .PrintTitleColumns = HeadCol '"$A:$A" .LeftHeader = "" .CenterHeader = "" .RightHeader = "" .LeftFooter = "" .CenterFooter = "" .RightFooter = "Page &P" .LeftMargin = Application.InchesToPoints(xlsLeft) .RightMargin = Application.InchesToPoints(xlsRight) .TopMargin = Application.InchesToPoints(xlsTop) .BottomMargin = Application.InchesToPoints(xlsBottom) .HeaderMargin = Application.InchesToPoints(xlsHeader) .FooterMargin = Application.InchesToPoints(xlsFooter) .PrintHeadings = False .PrintGridlines = False .PrintComments = xlPrintNoComments .PrintQuality = 600 .CenterHorizontally = False .CenterVertically = False .Orientation = xlLandscape .Draft = False .PaperSize = xlPaperLetter .FirstPageNumber = xlAutomatic .Order = xlDownThenOver .BlackAndWhite = False .Zoom = xlsZoom End With End Sub




Reply With Quote