Junior1544
Technical User
i have a vba macro to print the current sheet... i want to make it run faster, but i don't know if i can have certain things default, and leave them out, or if there is a faster way to do it all together... here is my code if some one can help me make it run faster... Thanks
--James
Sub Print()
On Error GoTo err_Print
ActiveSheet.PageSetup.PrintArea = "$B$2:$H$19"
With ActiveSheet.PageSetup
.PrintTitleRows = ""
.PrintTitleColumns = ""
End With
With ActiveSheet.PageSetup
.LeftHeader = ""
.CenterHeader = ""
.RightHeader = ""
.LeftFooter = ""
.CenterFooter = ""
.RightFooter = ""
.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)
.PrintHeadings = False
.PrintGridlines = False
.PrintComments = xlPrintNoComments
.CenterHorizontally = True
.CenterVertically = True
.Orientation = xlLandscape
.Draft = False
.PaperSize = xlPaperLetter
.FirstPageNumber = xlAutomatic
.Order = xlDownThenOver
.BlackAndWhite = False
.Zoom = 170
End With
ActiveWindow.SelectedSheets.PrintOut Copies:=1
Range("B11".Select
exit_Print:
Exit Sub
err_Print:
MsgBox "Called From: VB_General.Print " & Chr$(10) & Chr$(13) & "Error Description: " & Err.Description & Chr$(10) & Chr$(13) & "Error Code: " & Err.Number, vbCritical
GoTo exit_Print
End Sub JHauge@jmjpc.net
Life is change. To deny change is to deny life.
--James
Sub Print()
On Error GoTo err_Print
ActiveSheet.PageSetup.PrintArea = "$B$2:$H$19"
With ActiveSheet.PageSetup
.PrintTitleRows = ""
.PrintTitleColumns = ""
End With
With ActiveSheet.PageSetup
.LeftHeader = ""
.CenterHeader = ""
.RightHeader = ""
.LeftFooter = ""
.CenterFooter = ""
.RightFooter = ""
.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)
.PrintHeadings = False
.PrintGridlines = False
.PrintComments = xlPrintNoComments
.CenterHorizontally = True
.CenterVertically = True
.Orientation = xlLandscape
.Draft = False
.PaperSize = xlPaperLetter
.FirstPageNumber = xlAutomatic
.Order = xlDownThenOver
.BlackAndWhite = False
.Zoom = 170
End With
ActiveWindow.SelectedSheets.PrintOut Copies:=1
Range("B11".Select
exit_Print:
Exit Sub
err_Print:
MsgBox "Called From: VB_General.Print " & Chr$(10) & Chr$(13) & "Error Description: " & Err.Description & Chr$(10) & Chr$(13) & "Error Code: " & Err.Number, vbCritical
GoTo exit_Print
End Sub JHauge@jmjpc.net
Life is change. To deny change is to deny life.