Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi Folks,
I'm looking to set some page stup options for the selected sheet or sheets via a macro with will run at Before_Print. I'm sure my problem has a simple solution but I think I've been looking at it for too long to see it. Because I want to account to a user selection of potentially more than a single sheet Im' am trying to work with some sort of activesheet parameter. i've tried a few combinations of For or With statements and just keep getting different errors. Dim ws As Worksheet For Each ws In ThisWorkbook.ActiveSheet ws.PageSetup.PrintArea = "$A$1:$U$90" ws.PageSetup.Orientation = xlLandscape ws.PageSetup.CenterHorizontally = True ws.PageSetup.CenterVertically = False ws.PageSetup.HeaderMargin = Application.InchesToPoints(0) ws.PageSetup.BottomMargin = Application.InchesToPoints(0.75) ws.PageSetup.FooterMargin = Application.InchesToPoints(0.5) ws.PageSetup.LeftMargin = Application.InchesToPoints(0.25) ws.PageSetup.RightMargin = Application.InchesToPoints(0.25) ws.PageSetup.TopMargin = Application.InchesToPoints(0.25) ws.PageSetup.FitToPagesTall = 1 ws.PageSetup.FitToPagesWide = 1 Next aws |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Protect Sheet from Page Setup | Excel Discussion (Misc queries) | |||
Gridlines do not print, it is selected in sheet setup | Setting up and Configuration of Excel | |||
Excel page setup Sheet Print Cells Error As... | Excel Discussion (Misc queries) | |||
Excel Page Setup on selected worksheets | Excel Programming | |||
Copy Page Setup from Sheet to Sheet? | Excel Discussion (Misc queries) |