mark hansen
Well-known Member
- Joined
- Mar 6, 2006
- Messages
- 534
- Office Version
- 2016
- Platform
- Windows
I've done some searches but only came up with how to set a print area with VBA... I want to go the other way.
I have print area set and need to set that range into a range variable to use in a sub routine.
I'm using a loop to go through my sheets with charts and need to save those charts as a JPG file to display in SharePoint. Each chart has a print area set already so it can be printed to paper.
I am able to take a range, that "hard coded" within the code and save that range to a JPG file. But I need the to use the print area range.
I start out like:
Dim PA as range 'PA = print area
Then in the loop I have a case statement that looks at the worksheet name
Case "All"
xFileName = ws.name & ".JPG
with Sheet14 ' ("All" ws)
Call SaveAsJPG (.Range("BC30:BQ106"), PathtoSave, xfilename)
end with
You can see I use BC30:BQ106 as the range to have in the JPG. This is the print area for the sheet.
Can I set the established Print area and use that as range to send to the SaveAsJPG routine?
Thanks
Mark
I have print area set and need to set that range into a range variable to use in a sub routine.
I'm using a loop to go through my sheets with charts and need to save those charts as a JPG file to display in SharePoint. Each chart has a print area set already so it can be printed to paper.
I am able to take a range, that "hard coded" within the code and save that range to a JPG file. But I need the to use the print area range.
I start out like:
Dim PA as range 'PA = print area
Then in the loop I have a case statement that looks at the worksheet name
Case "All"
xFileName = ws.name & ".JPG
with Sheet14 ' ("All" ws)
Call SaveAsJPG (.Range("BC30:BQ106"), PathtoSave, xfilename)
end with
You can see I use BC30:BQ106 as the range to have in the JPG. This is the print area for the sheet.
Can I set the established Print area and use that as range to send to the SaveAsJPG routine?
Thanks
Mark