ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Changing the print_area (https://www.excelbanter.com/excel-programming/375779-changing-print_area.html)

ArthurJ

Changing the print_area
 
With code I would like to change the print_area range to be the same as
another range. Something like these three lines (though this doesn't work):

Dim r As Range
Set r = range("myRange")
Range("print_area") = r

How do I do this?

Ken

Changing the print_area
 
Arthur

Try:

ActiveSheet.PageSetup.PrintArea = "myRange"

Good luck

Ken
Norfolk, Va


ArthurJ wrote:
With code I would like to change the print_area range to be the same as
another range. Something like these three lines (though this doesn't work):

Dim r As Range
Set r = range("myRange")
Range("print_area") = r

How do I do this?



NickHK

Changing the print_area
 
If you check "PrintArea" in the Help or the Object Browser, you will see if
returns/sets a String.
So you need to pass the address of the Range object, not the Range object
itself.

NickHK

"ArthurJ" wrote in message
...
With code I would like to change the print_area range to be the same as
another range. Something like these three lines (though this doesn't

work):

Dim r As Range
Set r = range("myRange")
Range("print_area") = r

How do I do this?





All times are GMT +1. The time now is 08:35 PM.

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