Jmorrison67
Board Regular
- Joined
- Aug 20, 2021
- Messages
- 51
- Office Version
- 2016
- Platform
- Windows
Good afternoon Community,
I am looking for help on how to save the print area's when copying worksheets to a new workbook (excel to excel). User Akuini has helped tremendously to get the code I need to where it is now.
I am currently using this parameter when saving worksheets to pdf >
and works as expected for pdf, but I also need to adapt the excel equivalent code which Akuini helped with so that I only save the print area's in the new excel workbook.
Bit about the file I am using:
Workbook has 95 tabs
All worksheets have different Print Area ranges as all contain different tables of info and graphs
I use the whole workbook to pull out different worksheets for different managers to see different info
Each manager (8 or so) gets a combination of different worksheets, with most any one manager gets is 35 worksheets.
There is just as much data outside the print area's, so it is essential the managers only see the print area data
This is the output bit of the code:
Can anyone help in getting the 'print areas' bit added to the code for when I have to save these down as excel workbooks?
KR
Jmorrison67
I am looking for help on how to save the print area's when copying worksheets to a new workbook (excel to excel). User Akuini has helped tremendously to get the code I need to where it is now.
I am currently using this parameter when saving worksheets to pdf >
VBA Code:
IgnorePrintAreas:=False
Bit about the file I am using:
Workbook has 95 tabs
All worksheets have different Print Area ranges as all contain different tables of info and graphs
I use the whole workbook to pull out different worksheets for different managers to see different info
Each manager (8 or so) gets a combination of different worksheets, with most any one manager gets is 35 worksheets.
There is just as much data outside the print area's, so it is essential the managers only see the print area data
This is the output bit of the code:
VBA Code:
Sheets(ary).Copy
For Each ws In ActiveWorkbook.Worksheets
With ws.UsedRange
.Value = .Value
End With
Next ws
With ActiveWorkbook
.SaveAs Filename:=FolderPath & " - " & Format(Now, "dd-mm-yyyy hhmm") & ".xlsx"
.Close
End With
MsgBox "Excel file has been successfully exported."
End Sub
Can anyone help in getting the 'print areas' bit added to the code for when I have to save these down as excel workbooks?
KR
Jmorrison67