Thread: Excel papertype
View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Peter A[_3_] Peter A[_3_] is offline
external usenet poster
 
Posts: 1
Default Excel papertype

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.


.