Excel papertype

Z

Zakounou

Hi,

I would like to set the papertype of a worksheet in a
macro.
Please could you help me?

Thanks.
 
P

Peter A

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
 
B

Bob Phillips

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)
 
G

Guest

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.
 
Top