thoffmann11
New Member
- Joined
- Nov 12, 2015
- Messages
- 2
I am using Mac, Excel 2011.
I have recorded a macro to select a certain area, create the page setups but I am unable to figure out how to set it up to print to pdf directly (instead of printing through the printer).
Anybody, any idea how to handle this?
Sub printpdf()
'
' printpdf Macro
'
'
ActiveSheet.PageSetup.PrintArea = "$A$1:$S$34"
ActiveSheet.PageSetup.PrintArea = "$A$1:$S$34"
With ActiveSheet.PageSetup
.LeftMargin = Application.InchesToPoints(0.75)
.RightMargin = Application.InchesToPoints(0)
.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 = -4
.CenterHorizontally = True
.CenterVertically = True
.Orientation = xlLandscape
.Draft = False
.PaperSize = xlPaperLetter
.FirstPageNumber = xlAutomatic
.Order = xlDownThenOver
.BlackAndWhite = False
.Zoom = False
.FitToPagesWide = 1
.FitToPagesTall = 1
End With
ActiveWindow.SelectedSheets.PrintOut From:=1, To:=1, Copies:=1
End Sub
I have recorded a macro to select a certain area, create the page setups but I am unable to figure out how to set it up to print to pdf directly (instead of printing through the printer).
Anybody, any idea how to handle this?
Sub printpdf()
'
' printpdf Macro
'
'
ActiveSheet.PageSetup.PrintArea = "$A$1:$S$34"
ActiveSheet.PageSetup.PrintArea = "$A$1:$S$34"
With ActiveSheet.PageSetup
.LeftMargin = Application.InchesToPoints(0.75)
.RightMargin = Application.InchesToPoints(0)
.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 = -4
.CenterHorizontally = True
.CenterVertically = True
.Orientation = xlLandscape
.Draft = False
.PaperSize = xlPaperLetter
.FirstPageNumber = xlAutomatic
.Order = xlDownThenOver
.BlackAndWhite = False
.Zoom = False
.FitToPagesWide = 1
.FitToPagesTall = 1
End With
ActiveWindow.SelectedSheets.PrintOut From:=1, To:=1, Copies:=1
End Sub