C
CLR
Hi All.....
I recorded a Macro to print two ranges from a sheet. The first is printed
in Portrait view, and the second in Landscape. It works just fine, except
that it runs very very slowly, and since I have 12 of these to run in
succession it takes a long time......I tried just changing the PrintQuality
value from -4 to -1 but that just changed the quality of the printout and not
the speed of the macro.....can anybody suggest how I might speed this macro
up please?
Sub Print30210twosheets()
'***********************************************************
'This macro runs an individual Department Print MonthFiles macros
'***********************************************************
Sheets("Months").Select
'Print30210_1
Application.GoTo Reference:="Print30210_1"
ActiveSheet.PageSetup.PrintArea = "$A$1:$H$48"
With ActiveSheet.PageSetup
.PrintTitleRows = ""
.PrintTitleColumns = ""
End With
ActiveSheet.PageSetup.PrintArea = "$A$1:$H$48"
With ActiveSheet.PageSetup
.LeftHeader = ""
.CenterHeader = ""
.RightHeader = ""
.LeftFooter = "Printed by: crober"
.CenterFooter = ""
.RightFooter = _
"D:\Linvatec\QRB_Report\Oct2004NEW\QRBtest9\ChucksDPMcalcsMasterC.xls"
.LeftMargin = Application.InchesToPoints(0.25)
.RightMargin = Application.InchesToPoints(0.25)
.TopMargin = Application.InchesToPoints(0.5)
.BottomMargin = Application.InchesToPoints(0.25)
.HeaderMargin = Application.InchesToPoints(0.5)
.FooterMargin = Application.InchesToPoints(0.5)
.PrintHeadings = False
.PrintGridlines = False
.PrintComments = xlPrintNoComments
.PrintQuality = -4
.CenterHorizontally = True
.CenterVertically = False
.Orientation = xlPortrait
.Draft = False
.PaperSize = xlPaperLetter
.FirstPageNumber = xlAutomatic
.Order = xlDownThenOver
.BlackAndWhite = False
.Zoom = False
.FitToPagesWide = 1
.FitToPagesTall = 1
End With
ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True
'Print30210_2
Application.GoTo Reference:="Print30210_2"
ActiveSheet.PageSetup.PrintArea = "$J$1:$AC$48"
With ActiveSheet.PageSetup
.PrintTitleRows = ""
.PrintTitleColumns = ""
End With
ActiveSheet.PageSetup.PrintArea = "$J$1:$AC$48"
With ActiveSheet.PageSetup
.LeftHeader = ""
.CenterHeader = ""
.RightHeader = ""
.LeftFooter = "Printed by: crober"
.CenterFooter = ""
.RightFooter = _
"D:\Linvatec\QRB_Report\Oct2004NEW\QRBtest9\ChucksDPMcalcsMasterC.xls"
.LeftMargin = Application.InchesToPoints(0.25)
.RightMargin = Application.InchesToPoints(0.25)
.TopMargin = Application.InchesToPoints(0.5)
.BottomMargin = Application.InchesToPoints(0.25)
.HeaderMargin = Application.InchesToPoints(0.5)
.FooterMargin = Application.InchesToPoints(0.5)
.PrintHeadings = False
.PrintGridlines = False
.PrintComments = xlPrintNoComments
.PrintQuality = -4
.CenterHorizontally = True
.CenterVertically = False
.Orientation = xlLandscape
.Draft = False
.PaperSize = xlPaperLetter
.FirstPageNumber = xlAutomatic
.Order = xlDownThenOver
.BlackAndWhite = False
.Zoom = False
.FitToPagesWide = 1
.FitToPagesTall = 1
End With
ActiveWindow.SelectedSheets.PrintOut Copies:=1
Sheets("Main").Select
Range("A1").Select
End Sub
TIA
Vaya con Dios,
Chuck, CABGx3
I recorded a Macro to print two ranges from a sheet. The first is printed
in Portrait view, and the second in Landscape. It works just fine, except
that it runs very very slowly, and since I have 12 of these to run in
succession it takes a long time......I tried just changing the PrintQuality
value from -4 to -1 but that just changed the quality of the printout and not
the speed of the macro.....can anybody suggest how I might speed this macro
up please?
Sub Print30210twosheets()
'***********************************************************
'This macro runs an individual Department Print MonthFiles macros
'***********************************************************
Sheets("Months").Select
'Print30210_1
Application.GoTo Reference:="Print30210_1"
ActiveSheet.PageSetup.PrintArea = "$A$1:$H$48"
With ActiveSheet.PageSetup
.PrintTitleRows = ""
.PrintTitleColumns = ""
End With
ActiveSheet.PageSetup.PrintArea = "$A$1:$H$48"
With ActiveSheet.PageSetup
.LeftHeader = ""
.CenterHeader = ""
.RightHeader = ""
.LeftFooter = "Printed by: crober"
.CenterFooter = ""
.RightFooter = _
"D:\Linvatec\QRB_Report\Oct2004NEW\QRBtest9\ChucksDPMcalcsMasterC.xls"
.LeftMargin = Application.InchesToPoints(0.25)
.RightMargin = Application.InchesToPoints(0.25)
.TopMargin = Application.InchesToPoints(0.5)
.BottomMargin = Application.InchesToPoints(0.25)
.HeaderMargin = Application.InchesToPoints(0.5)
.FooterMargin = Application.InchesToPoints(0.5)
.PrintHeadings = False
.PrintGridlines = False
.PrintComments = xlPrintNoComments
.PrintQuality = -4
.CenterHorizontally = True
.CenterVertically = False
.Orientation = xlPortrait
.Draft = False
.PaperSize = xlPaperLetter
.FirstPageNumber = xlAutomatic
.Order = xlDownThenOver
.BlackAndWhite = False
.Zoom = False
.FitToPagesWide = 1
.FitToPagesTall = 1
End With
ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True
'Print30210_2
Application.GoTo Reference:="Print30210_2"
ActiveSheet.PageSetup.PrintArea = "$J$1:$AC$48"
With ActiveSheet.PageSetup
.PrintTitleRows = ""
.PrintTitleColumns = ""
End With
ActiveSheet.PageSetup.PrintArea = "$J$1:$AC$48"
With ActiveSheet.PageSetup
.LeftHeader = ""
.CenterHeader = ""
.RightHeader = ""
.LeftFooter = "Printed by: crober"
.CenterFooter = ""
.RightFooter = _
"D:\Linvatec\QRB_Report\Oct2004NEW\QRBtest9\ChucksDPMcalcsMasterC.xls"
.LeftMargin = Application.InchesToPoints(0.25)
.RightMargin = Application.InchesToPoints(0.25)
.TopMargin = Application.InchesToPoints(0.5)
.BottomMargin = Application.InchesToPoints(0.25)
.HeaderMargin = Application.InchesToPoints(0.5)
.FooterMargin = Application.InchesToPoints(0.5)
.PrintHeadings = False
.PrintGridlines = False
.PrintComments = xlPrintNoComments
.PrintQuality = -4
.CenterHorizontally = True
.CenterVertically = False
.Orientation = xlLandscape
.Draft = False
.PaperSize = xlPaperLetter
.FirstPageNumber = xlAutomatic
.Order = xlDownThenOver
.BlackAndWhite = False
.Zoom = False
.FitToPagesWide = 1
.FitToPagesTall = 1
End With
ActiveWindow.SelectedSheets.PrintOut Copies:=1
Sheets("Main").Select
Range("A1").Select
End Sub
TIA
Vaya con Dios,
Chuck, CABGx3