ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Print Preview Input Range or From List (https://www.excelbanter.com/excel-programming/279985-print-preview-input-range-list.html)

spurtniq

Print Preview Input Range or From List
 
I'd like to setup a macro (for now) that either:

Allows me to use an input box to type in a range name
which is then sent to Print Preview

or

Allows me select a range name from a list, such as

Range Names:

Pg_1
Pg_2
Pg_3
etc

and then would likewise send the range to
Print Preview

These ranges are spread out across several worksheets
so, selection of the range would have to take that into account as
well.

I thought this wouldn't be too difficult, but, I've been working on
this for a few days now with no luck.

Thanx.



------------------------------------------------
~~ Message posted from http://www.ExcelTip.com/
~~ View and post usenet messages directly from http://www.ExcelForum.com/


Ron de Bruin

Print Preview Input Range or From List
 
One way

On a empty sheet

Insert NamePaste
Paste list

You can use this macro when you have select a name in the A column

Sub test()
On Error Resume Next
Range(ActiveCell.Value).PrintPreview
On Error GoTo 0
End Sub


--
Regards Ron de Bruin
(Win XP Pro SP-1 XL2002 SP-2)
www.rondebruin.nl



"spurtniq" wrote in message ...
I'd like to setup a macro (for now) that either:

Allows me to use an input box to type in a range name
which is then sent to Print Preview

or

Allows me select a range name from a list, such as

Range Names:

Pg_1
Pg_2
Pg_3
etc

and then would likewise send the range to
Print Preview

These ranges are spread out across several worksheets
so, selection of the range would have to take that into account as
well.

I thought this wouldn't be too difficult, but, I've been working on
this for a few days now with no luck.

Thanx.



------------------------------------------------
~~ Message posted from http://www.ExcelTip.com/
~~ View and post usenet messages directly from http://www.ExcelForum.com/




keepITcool

Print Preview Input Range or From List
 

spurtnic,

this aint perfect, but it'll do what you want:

Sub GoAndPreView()
if Application.Dialogs(xlDialogFormulaGoto).Show then
ActiveSheet.PageSetup.PrintArea = Selection.Address
ActiveSheet.PrintPreview
endif
End Sub


keepITcool

< email : keepitcool chello nl (with @ and .)
< homepage: http://members.chello.nl/keepitcool


spurtniq wrote:

I'd like to setup a macro (for now) that either:

Allows me to use an input box to type in a range name
which is then sent to Print Preview

or

Allows me select a range name from a list, such as

Range Names:

Pg_1
Pg_2
Pg_3
etc

and then would likewise send the range to
Print Preview

These ranges are spread out across several worksheets
so, selection of the range would have to take that into account as
well.

I thought this wouldn't be too difficult, but, I've been working on
this for a few days now with no luck.

Thanx.



------------------------------------------------
~~ Message posted from http://www.ExcelTip.com/
~~ View and post usenet messages directly from

http://www.ExcelForum.com/




spurtniq[_2_]

Print Preview Input Range or From List
 
Both solutions!

Thank you very much!



------------------------------------------------
~~ Message posted from http://www.ExcelTip.com/
~~ View and post usenet messages directly from http://www.ExcelForum.com/



All times are GMT +1. The time now is 12:13 PM.

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