ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   setting print area to selected cells (https://www.excelbanter.com/excel-discussion-misc-queries/120540-setting-print-area-selected-cells.html)

[email protected]

setting print area to selected cells
 
Hi. Is there are way to set the print area based on the cells that are
currently selected/highlighted? So, this time I have the range A1:D27
highlighted and I want that to be the print area, but next time I want
B9:KE102 to be the print area. I've figured out how to have a macro
select the area I want, but don't know how to have a "flexible" print
area. thanks in advance


Dave Peterson

setting print area to selected cells
 
Maybe you don't have to change the print area??

If you're selecting the range, you could use:

Selection.printout 'preview:=true

or without selecting:

with worksheets("somenamehere")
.range("a1:d27").printout
.range("b9:ke102").printout
end with


wrote:

Hi. Is there are way to set the print area based on the cells that are
currently selected/highlighted? So, this time I have the range A1:D27
highlighted and I want that to be the print area, but next time I want
B9:KE102 to be the print area. I've figured out how to have a macro
select the area I want, but don't know how to have a "flexible" print
area. thanks in advance


--

Dave Peterson

bobocat

setting print area to selected cells
 
After you select the cells
File-print- Print what - selection


egroups.com...
Hi. Is there are way to set the print area based on the cells that are
currently selected/highlighted? So, this time I have the range A1:D27
highlighted and I want that to be the print area, but next time I want
B9:KE102 to be the print area. I've figured out how to have a macro
select the area I want, but don't know how to have a "flexible" print
area. thanks in advance




[email protected]

setting print area to selected cells
 
Thanks guys. Here's where I'm at... I have this line of code below,
and I need to know what term/code I can put after the = that will refer
to the selected cells.

ActiveSheet.PageSetup.PrintArea = [what can I put here to refer to my
selected cells?]



Dave Peterson wrote:
Maybe you don't have to change the print area??

If you're selecting the range, you could use:

Selection.printout 'preview:=true

or without selecting:

with worksheets("somenamehere")
.range("a1:d27").printout
.range("b9:ke102").printout
end with


wrote:

Hi. Is there are way to set the print area based on the cells that are
currently selected/highlighted? So, this time I have the range A1:D27
highlighted and I want that to be the print area, but next time I want
B9:KE102 to be the print area. I've figured out how to have a macro
select the area I want, but don't know how to have a "flexible" print
area. thanks in advance


--

Dave Peterson



Dave Peterson

setting print area to selected cells
 
I still wouldn't change the printarea. I'd just print the selection. But if
you want...

ActiveSheet.PageSetup.PrintArea = Selection.address



wrote:

Thanks guys. Here's where I'm at... I have this line of code below,
and I need to know what term/code I can put after the = that will refer
to the selected cells.

ActiveSheet.PageSetup.PrintArea = [what can I put here to refer to my
selected cells?]

Dave Peterson wrote:
Maybe you don't have to change the print area??

If you're selecting the range, you could use:

Selection.printout 'preview:=true

or without selecting:

with worksheets("somenamehere")
.range("a1:d27").printout
.range("b9:ke102").printout
end with


wrote:

Hi. Is there are way to set the print area based on the cells that are
currently selected/highlighted? So, this time I have the range A1:D27
highlighted and I want that to be the print area, but next time I want
B9:KE102 to be the print area. I've figured out how to have a macro
select the area I want, but don't know how to have a "flexible" print
area. thanks in advance


--

Dave Peterson


--

Dave Peterson


All times are GMT +1. The time now is 01:08 AM.

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