Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Excel Page Setup on selected worksheets
I have the following code which produced error:
Sub formatallselected() Dim Sh As Worksheet For Each Sh In activeworkbooks.SelectedSheets With ActiveSheet.PageSetup .PrintTitleRows = "" .PrintTitleColumns = "" End With ActiveSheet.PageSetup.PrintArea = "$A$1:$AA$35" With ActiveSheet.PageSetup .LeftHeader = "" .CenterHeader = "" .RightHeader = "" .LeftFooter = "" .CenterFooter = "&A" .RightFooter = "" .LeftMargin = Application.InchesToPoints(0.75) .RightMargin = Application.InchesToPoints(0.75) .TopMargin = Application.InchesToPoints(1) .BottomMargin = Application.InchesToPoints(1) .HeaderMargin = Application.InchesToPoints(0.5) .FooterMargin = Application.InchesToPoints(0.5) .PrintHeadings = False .PrintGridlines = False .PrintComments = xlPrintNoComments .PrintQuality = 600 .CenterHorizontally = True .CenterVertically = False .Orientation = xlLandscape .Draft = False .PaperSize = xlPaperLetter .FirstPageNumber = xlAutomatic .Order = xlDownThenOver .BlackAndWhite = False .Zoom = False .FitToPagesWide = 1 .FitToPagesTall = 1 .PrintErrors = xlPrintErrorsDisplayed End With Next End Sub Can someone kind enough to help? Any comment is much appreciated. TIA |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
How do I get the Page Setup to apply to all the worksheets? | Excel Discussion (Misc queries) | |||
changing the page setup for multiple worksheets in a workbook | Excel Discussion (Misc queries) | |||
Page Setup Across Multiple Worksheets | Excel Worksheet Functions | |||
Page Setup for multiple worksheets macro problem | Excel Discussion (Misc queries) | |||
How can I copy page setup settings to other worksheets? Thanks | Excel Discussion (Misc queries) |