+ Reply to Thread
Results 1 to 3 of 3

Select Printer Macro

  1. #1
    Registered User
    Join Date
    06-14-2005
    Posts
    22

    Select Printer Macro

    I currently have a spreadsheet that I run a macro on to save the sheet and print 2 copies out. This works OK.

    In some cases I now need to output as a PDF and print 1 copy.

    I have found the relevant code for swapping the active printer to my PDF printer and back, however, what I would like is one print button that knows whether I require 2 printed copies or 1 PDF+1 print.

    I have put a vlookup on my sheet to find and show this setting in cell L2; so basically I want the macro to run

    IF L2 <> PDF then print 2 copies ELSE print 1 to pdfprinter and 1 to printer.

    How do I build this IF statement into my current code?

    Thanks

  2. #2
    Forum Contributor
    Join Date
    03-24-2005
    Location
    Wisconsin
    MS-Off Ver
    2007
    Posts
    378

    Can you post your code?

    Can you post your code?

    See this thread for a similar issue. http://www.excelforum.com/showthread...09210#poststop
    The solution was to put this code into the ThisWorkbook module:
    Please Login or Register  to view this content.
    That sort of approach should help your resolution, but now Juda would like to do exactly what you are already doing and your approach could also help in that situation.
    Thanks!
    Dennis

    I am using Windows 7 and Office 2007, all of my posts are based on this.

  3. #3
    Registered User
    Join Date
    06-14-2005
    Posts
    22
    You will see I have already posted a reply in your other thread about the automated printer selection.

    Since posting I have "played" a little more, and using other ideas/codes, I have come up with the following :

    PHP Code: 
    Sub PrintInvoice()
    Dim response
    Sheet1
    .Select
    Select 
    Case Range("L2").Value
    Case "PDF"
        'MsgBox ("PDF")
        Sheet1.PrintOut Copies:=1, ActivePrinter:="PDF995", Collate:=True
        '
    Call PrintToAnotherPrinter
    Case Else
        
    'MsgBox ("Other")
        Sheet1.PrintOut Copies:=2, Collate:=True
    End Select 
    which seems a little easier than before (i have yet to test this fully). I have also used the autoprint function of pdf995 to output a copy to the printer.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1