Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi,
I would like to set the papertype of a worksheet in a macro. Please could you help me? Thanks. |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Zakounou
When your'e trying something new record your'e steps while you are doing the task manually. You will end up with a lot of False statements and you can safely reomove these. Here is one I just recorded and then edited. Sub PaperType() With ActiveSheet.PageSetup .PrintTitleRows = "$1:$1" .PrintTitleColumns = "$A:$A" End With ActiveSheet.PageSetup.PrintArea = "" With ActiveSheet.PageSetup .LeftMargin = Application.InchesToPoints(0.5) .RightMargin = Application.InchesToPoints(0.5) .TopMargin = Application.InchesToPoints(1) .BottomMargin = Application.InchesToPoints(1) .HeaderMargin = Application.InchesToPoints(0.5) .FooterMargin = Application.InchesToPoints(0.5) .PrintComments = xlPrintNoComments .PrintQuality = 300 .CenterHorizontally = True .CenterVertically = False .Orientation = xlLandscape .PaperSize = xlPaperA4 .FirstPageNumber = xlAutomatic .Order = xlDownThenOver .FitToPagesWide = 1 .FitToPagesTall = 1 End With End Sub -----Original Message----- Hi, I would like to set the papertype of a worksheet in a macro. Please could you help me? Thanks. . |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
As most of these are defaults, you can condense to just the bit you want
Sub PaperType() With ActiveSheet.PageSetup .PaperSize = xlPaperA4 End With End Sub -- HTH Bob Phillips ... looking out across Poole Harbour to the Purbecks (remove nothere from the email address if mailing direct) "Peter A" wrote in message ... Zakounou When your'e trying something new record your'e steps while you are doing the task manually. You will end up with a lot of False statements and you can safely reomove these. Here is one I just recorded and then edited. Sub PaperType() With ActiveSheet.PageSetup .PrintTitleRows = "$1:$1" .PrintTitleColumns = "$A:$A" End With ActiveSheet.PageSetup.PrintArea = "" With ActiveSheet.PageSetup .LeftMargin = Application.InchesToPoints(0.5) .RightMargin = Application.InchesToPoints(0.5) .TopMargin = Application.InchesToPoints(1) .BottomMargin = Application.InchesToPoints(1) .HeaderMargin = Application.InchesToPoints(0.5) .FooterMargin = Application.InchesToPoints(0.5) .PrintComments = xlPrintNoComments .PrintQuality = 300 .CenterHorizontally = True .CenterVertically = False .Orientation = xlLandscape .PaperSize = xlPaperA4 .FirstPageNumber = xlAutomatic .Order = xlDownThenOver .FitToPagesWide = 1 .FitToPagesTall = 1 End With End Sub -----Original Message----- Hi, I would like to set the papertype of a worksheet in a macro. Please could you help me? Thanks. . |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
thx for your answer but it's not the papersize that i
would like to change. I would like to print preprinted paper. For this i must set the paperbin or the papertype but i don't see this properties. -----Original Message----- As most of these are defaults, you can condense to just the bit you want Sub PaperType() With ActiveSheet.PageSetup .PaperSize = xlPaperA4 End With End Sub -- HTH Bob Phillips ... looking out across Poole Harbour to the Purbecks (remove nothere from the email address if mailing direct) "Peter A" wrote in message ... Zakounou When your'e trying something new record your'e steps while you are doing the task manually. You will end up with a lot of False statements and you can safely reomove these. Here is one I just recorded and then edited. Sub PaperType() With ActiveSheet.PageSetup .PrintTitleRows = "$1:$1" .PrintTitleColumns = "$A:$A" End With ActiveSheet.PageSetup.PrintArea = "" With ActiveSheet.PageSetup .LeftMargin = Application.InchesToPoints(0.5) .RightMargin = Application.InchesToPoints(0.5) .TopMargin = Application.InchesToPoints(1) .BottomMargin = Application.InchesToPoints(1) .HeaderMargin = Application.InchesToPoints(0.5) .FooterMargin = Application.InchesToPoints(0.5) .PrintComments = xlPrintNoComments .PrintQuality = 300 .CenterHorizontally = True .CenterVertically = False .Orientation = xlLandscape .PaperSize = xlPaperA4 .FirstPageNumber = xlAutomatic .Order = xlDownThenOver .FitToPagesWide = 1 .FitToPagesTall = 1 End With End Sub -----Original Message----- Hi, I would like to set the papertype of a worksheet in a macro. Please could you help me? Thanks. . . |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|