Printing to a specific printer

JonKeane

New Member
Joined
Jul 27, 2005
Messages
29
Morning all, hoping somebody could assist with a small query I have.

I have a workbook with a button that allows me to select worksheets that have been filled out and send them to the printer. At the moment it will print to whatever the default printer is set to. I use the below code to print the active worksheet;

ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True

Is it possible I can specify what printer to use. I have tried using the 'To' command but this just does nothing.

I also need to be able to specify what sheets to print out. Is it possible to print a sheet by its name?

Thanks for any help in advance.

Jon
 

Excel Facts

Does the VLOOKUP table have to be sorted?
No! when you are using an exact match, the VLOOKUP table can be in any order. Best-selling items at the top is actually the best.
I use this code to bring up the print option and then select whatever printer I require.

Private Sub cmdPrint_Click()
Sheets("Form").Select
Application.Dialogs(xlDialogPrint).Show
Sheets("Input").Select
Range("B3").Select
End Sub
 
Upvote 0
MasterChief, I have looked at your code and cannot see how to work it into my existing code. Below is the code I am using to select which sheets to print;

For Each ws In ActiveWorkbook.Worksheets
If ws.Range("C12") = vProjectNumber Then
ws.Select
ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True
End If
Next ws

Also how do I tell it specificly print a sheet by it name. For example all my sheets are selected to print by having a job number on them, but the terms and conditions will be required each time, so I would like to add that to the code if possible.

Thanks

Jon
 
Upvote 0

Forum statistics

Threads
1,214,606
Messages
6,120,485
Members
448,967
Latest member
visheshkotha

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top