L
LadyReader
I have 12 charts on a spreadsheet, but the number can vary. I want t
print each chart on a separate page. Instead of setting up 12 prin
routines, I'd like to set up 1 routine with variable start cell and en
cell settings. The starting row of each chart is offset by 22 rows fro
the one before it.
I have:
Code
-------------------
Public Sub PrintCharts()
Dim StartCol As String
Dim EndCol As String
Dim StartRow As Single
Dim EndRow As Single
Dim Offset as Single
'Initialize:
StartCol = "A"
EndCol = "G"
StartRow = 1
EndRow = 21
Offset = 22
'Navigate to correct spreadsheet:
Sheets("ChartPage").Select
Range(Cells(StartRow, StartCol), Cells(EndRow, EndCol)).Select
ActiveSheet.PageSetup.PrintArea = Selection
...
End Sub
-------------------
The Select line executes but I get an error on the last line of code
where I try to set the PrintArea to my Selection.
The error is: "Unable to set the PrintArea property of the PageSetu
class"
Can anyone explain how I can achieve my goal of using variabl
references?
Thank yo
print each chart on a separate page. Instead of setting up 12 prin
routines, I'd like to set up 1 routine with variable start cell and en
cell settings. The starting row of each chart is offset by 22 rows fro
the one before it.
I have:
Code
-------------------
Public Sub PrintCharts()
Dim StartCol As String
Dim EndCol As String
Dim StartRow As Single
Dim EndRow As Single
Dim Offset as Single
'Initialize:
StartCol = "A"
EndCol = "G"
StartRow = 1
EndRow = 21
Offset = 22
'Navigate to correct spreadsheet:
Sheets("ChartPage").Select
Range(Cells(StartRow, StartCol), Cells(EndRow, EndCol)).Select
ActiveSheet.PageSetup.PrintArea = Selection
...
End Sub
-------------------
The Select line executes but I get an error on the last line of code
where I try to set the PrintArea to my Selection.
The error is: "Unable to set the PrintArea property of the PageSetu
class"
Can anyone explain how I can achieve my goal of using variabl
references?
Thank yo