Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 94
Default Print specific range but user to select printer

Hi, I have the following in one of my macros to print to the default printer.

Worksheets("Disinfections").Range("pen_list").Prin tOut

How do I change this so that the print dialog box pops up to allow the user
to select the printer and page size?

Happy New Year! (nearly)
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,533
Default Print specific range but user to select printer

Hi

This will save Default printer, let user print out on selected printer and
return to default printer.

MyPrinter = ActivePrinter
Application.Dialogs(8).Show ' Show Printer Dialog!
Worksheets("Disinfections").Range("pen_list").Prin tOut
Application.ActivePrinter = MyPrinter



Happy New Year!

Per


"Code Numpty" skrev i meddelelsen
...
Hi, I have the following in one of my macros to print to the default
printer.

Worksheets("Disinfections").Range("pen_list").Prin tOut

How do I change this so that the print dialog box pops up to allow the
user
to select the printer and page size?

Happy New Year! (nearly)


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 94
Default Print specific range but user to select printer

Thanks Per,

What happens now is that I get 2 prints.
The first bit of code
Application.Dialogs(8).Show ' Show Printer Dialog!
prints the area of the sheet containing data or formatting from the print
dialog.
Then the second bit of code
Worksheets("Disinfections").Range("pen_list").Prin tOut
prints out the specified range.

The second print is correct because it is a dynamic named range.
How can I get the macro to print the named range through the print dialog box?

"Per Jessen" wrote:

Hi

This will save Default printer, let user print out on selected printer and
return to default printer.

MyPrinter = ActivePrinter
Application.Dialogs(8).Show ' Show Printer Dialog!
Worksheets("Disinfections").Range("pen_list").Prin tOut
Application.ActivePrinter = MyPrinter



Happy New Year!

Per


"Code Numpty" skrev i meddelelsen
...
Hi, I have the following in one of my macros to print to the default
printer.

Worksheets("Disinfections").Range("pen_list").Prin tOut

How do I change this so that the print dialog box pops up to allow the
user
to select the printer and page size?

Happy New Year! (nearly)


.

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,533
Default Print specific range but user to select printer

Well, then try Dialogs(9), it will not print the document

Regards,
Per

"Code Numpty" skrev i meddelelsen
...
Thanks Per,

What happens now is that I get 2 prints.
The first bit of code
Application.Dialogs(8).Show ' Show Printer Dialog!
prints the area of the sheet containing data or formatting from the print
dialog.
Then the second bit of code
Worksheets("Disinfections").Range("pen_list").Prin tOut
prints out the specified range.

The second print is correct because it is a dynamic named range.
How can I get the macro to print the named range through the print dialog
box?

"Per Jessen" wrote:

Hi

This will save Default printer, let user print out on selected printer
and
return to default printer.

MyPrinter = ActivePrinter
Application.Dialogs(8).Show ' Show Printer Dialog!
Worksheets("Disinfections").Range("pen_list").Prin tOut
Application.ActivePrinter = MyPrinter



Happy New Year!

Per


"Code Numpty" skrev i meddelelsen
...
Hi, I have the following in one of my macros to print to the default
printer.

Worksheets("Disinfections").Range("pen_list").Prin tOut

How do I change this so that the print dialog box pops up to allow the
user
to select the printer and page size?

Happy New Year! (nearly)


.


  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 94
Default Print specific range but user to select printer

Thanks Per! Just the job. I've never come across Dialogs(8) or (9) before and
will check them out. You help is much appreciated.

Sharon

"Per Jessen" wrote:

Well, then try Dialogs(9), it will not print the document

Regards,
Per


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Trying to select a specific range based on the time value of user form input Jitranijam New Users to Excel 8 November 15th 06 01:52 AM
User select printer in print macro sarah_tennessee Excel Programming 0 April 7th 06 07:56 PM
User select printer in print macro rocket0612[_11_] Excel Programming 5 April 7th 06 07:49 AM
create a pause in print macro to allow user to select printer Scott53 Excel Programming 1 September 7th 05 04:29 PM
My First User Form - How to Select Range(s) and Print Bruce Roberson[_2_] Excel Programming 3 July 25th 03 03:09 AM


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

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"