What would be the code for setting the print area equal to the currently selected range on a sheet (i.e. not just e.g. "a1:d4", but something that changes?
What would be the code for setting the print area equal to the currently selected range on a sheet (i.e. not just e.g. "a1:d4", but something that changes?
Last edited by wammer; 09-01-2005 at 07:23 PM.
Per the (verbatim) example in VBA help:
ActiveSheet.PageSetup.PrintArea = ActiveCell.CurrentRegion.Address
--
George Nicholson
Remove 'Junk' from return address.
"wammer" <[email protected]> wrote in
message news:[email protected]...
>
> What would be the code for setting the print area equal to the currently
> selected range on a sheet (i.e. not just e.g. "a1:d4", but something
> that changes?
>
>
> --
> wammer
> ------------------------------------------------------------------------
> wammer's Profile:
> http://www.excelforum.com/member.php...o&userid=12452
> View this thread: http://www.excelforum.com/showthread...hreadid=401350
>
Instead of fiddling with the printrange, maybe just printing the selection would
be enough:
selection.printout
(may not apply to what you really want to do, though.)
wammer wrote:
>
> What would be the code for setting the print area equal to the currently
> selected range on a sheet (i.e. not just e.g. "a1:d4", but something
> that changes?
>
> --
> wammer
> ------------------------------------------------------------------------
> wammer's Profile: http://www.excelforum.com/member.php...o&userid=12452
> View this thread: http://www.excelforum.com/showthread...hreadid=401350
--
Dave Peterson
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks