Results 1 to 3 of 3

Printing to a specific printer

This is a discussion on Printing to a specific printer within the Excel Questions forums, part of the Question Forums category; Morning all, hoping somebody could assist with a small query I have. I have a workbook with a button that ...

  1. #1
    New Member
    Join Date
    Jul 2005
    Posts
    29

    Default Printing to a specific printer

    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

  2. #2
    Board Regular
    Join Date
    Feb 2006
    Location
    Bristol
    Posts
    166

    Default

    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

  3. #3
    New Member
    Join Date
    Jul 2005
    Posts
    29

    Default

    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

Like this thread? Share it with others

Like this thread? Share it with others

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


DMCA.com