ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Print Macro (https://www.excelbanter.com/excel-programming/287583-print-macro.html)

Sam A

Print Macro
 
I have a set of sheets in a workbook where there are two
sections of data per sheet.
The workbook is saved with one set of data pre set in the
print set up.

However, I need to set a macro where the other set of data
per sheet will be printed, and then the print set up
returned to point to the first set of data.

Can I do something with named ranges etc?

Thanking you in advance.

Don Guillett[_4_]

Print Macro
 
You could use this to help you
Sub whatisprintarea()
prntarea = Range("Print_Area").Address
MsgBox prntarea
End Sub

something like this might work

for each ws in worksheets
with ws
..prntarea = Range("Print_Area").Address
..PageSetup.PrintArea = "$B$2:$c$22" 'or whatever
..printpreview
..pagesetup.printarea=prntarea
end with
next

--
Don Guillett
SalesAid Software

"Sam A" wrote in message
...
I have a set of sheets in a workbook where there are two
sections of data per sheet.
The workbook is saved with one set of data pre set in the
print set up.

However, I need to set a macro where the other set of data
per sheet will be printed, and then the print set up
returned to point to the first set of data.

Can I do something with named ranges etc?

Thanking you in advance.





All times are GMT +1. The time now is 02:48 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com