Paul Sansom
Board Regular
- Joined
- Jan 28, 2013
- Messages
- 178
- Office Version
- 2021
- 2016
- Platform
- Windows
Hi
Trying to Print dynamic ranges from different sheets in one print run.
I have the code below but I cant see why I doesn't populate, and I get an object error.
Guidance always appreciated
I also have an alt version with more print control . Same error , but also not sure if I can do this????
Pointers on feasibility appreciated???
Cheers Paul
Trying to Print dynamic ranges from different sheets in one print run.
I have the code below but I cant see why I doesn't populate, and I get an object error.
Guidance always appreciated
Code:
Sub PrintAllDataSheets()
' Print Initiate Investigate Validate Audit Implement Summary Page in sigle report
Dim arrSheets
Dim arrAreas
Dim i As Integer
arrSheets = Array("Initiate", "Investigate", "Validate", "Audit", "Implement")
arrAreas = Array("Print_Initiate", "Print_Investigate", "Print_Validate", "Print_Audit", "Print_Implement")
For i = 0 To UBound(arrSheets)
Sheets(arrSheets(i)).PageSetup.PrintArea = arrAreas(i)
arrAreas(i).PrintOut
Next
End Sub
I also have an alt version with more print control . Same error , but also not sure if I can do this????
Pointers on feasibility appreciated???
Code:
Sub PrintAllDataSheets1()
' Print Initiate Investigate Validate Audit Implement Summary Page in sigle report
Dim arrSheets
Dim arrAreas
Dim i As Integer
arrSheets = Array("Initiate", "Investigate", "Validate", "Audit", "Implement")
arrAreas = Array("Print_Initiate", "Print_Investigate", "Print_Validate", "Print_Audit", "Print_Implement")
For i = 0 To UBound(arrSheets)
With Sheets(arrSheets(i)).PageSetup
.PrintArea = arrAreas(i)
.Zoom = False
.FitToPagesWide = 1
.FitToPagesTall = 2
.Orientation = xlLandscape
.BlackAndWhite = False
arrAreas(i).PrintOut
End With
Next
End Sub
Cheers Paul