Results 1 to 4 of 4

Macro completes 1st step not 2nd. Also run time error

Threaded View

Chaty Macro completes 1st step not... 03-22-2017, 10:53 AM
6StringJazzer Re: Macro completes 1st step... 03-22-2017, 11:26 AM
Chaty Re: Macro completes 1st step... 03-22-2017, 11:47 AM
Chaty Re: Macro completes 1st step... 03-22-2017, 12:22 PM
  1. #1
    Registered User
    Join Date
    03-22-2017
    Location
    England
    MS-Off Ver
    2016
    Posts
    3

    Macro completes 1st step not 2nd. Also run time error

    Hey guys when running the following macro i can get a document to print but when it comes to case 7 I can only get the DR Label to print. I cant get the Lining HBJ to print am i missing something that would print both pages? It works fine with any of the cases before hand but any with 2 pages to print it will only print the 1st page.

    Also after I run the macro it comes up with ("Run-time error '13': Type mismatch) but the macro still works fine is their anyway to solve this?

    I'm sure its simple but im still learning this is only my 3rd macro and I don't spend much time on them so I'm a noob.

    Sub PrintStuff()
        Dim vShts As Variant
        vShts = Sheets("Main").Range("L9")
        If Not IsNumeric(vShts) Then
            Exit Sub
        Else
            Select Case vShts
                Case 1
                    Application.ActivePrinter = "Brother MFC-8880DN Printer" - Sheets("Lining HBJ").PrintOut
                Case 2
                    Application.ActivePrinter = "Brother MFC-8880DN Printer" - Sheets("Lining HOJ").PrintOut
                Case 3
                    Application.ActivePrinter = "Brother MFC-8880DN Printer" - Sheets("Lining MIT").PrintOut
                Case 4
                    Application.ActivePrinter = "Brother MFC-8880DN Printer" - Sheets("Lining REB MIT").PrintOut
                Case 5
                    Application.ActivePrinter = "Brother MFC-8880DN Printer" - Sheets("Lining Rebated").PrintOut
                Case 6
                    Application.ActivePrinter = "Brother HL-3140CW series Printer" - Sheets("Dr Label").PrintOut
                Case 7
                    Application.ActivePrinter = "Brother HL-3140CW series Printer" - Sheets("Dr Label").PrintOut
                    Application.ActivePrinter = "Brother MFC-8880DN Printer" - Sheets("Lining HBJ").PrintOut
                Case 8
                    Application.ActivePrinter = "Brother HL-3140CW series Printer" - Sheets("Dr Label").PrintOut
                    Application.ActivePrinter = "Brother MFC-8880DN Printer" - Sheets("Lining HOJ").PrintOut
                Case 9
                    Application.ActivePrinter = "Brother HL-3140CW series Printer" - Sheets("Dr Label").PrintOut
                    Application.ActivePrinter = "Brother MFC-8880DN Printer" - Sheets("Lining MIT").PrintOut
                Case 10
                    Application.ActivePrinter = "Brother HL-3140CW series Printer" - Sheets("Dr Label").PrintOut
                    Application.ActivePrinter = "Brother MFC-8880DN Printer" - Sheets("Lining REB MIT").PrintOut
                Case 11
                    Application.ActivePrinter = "Brother HL-3140CW series Printer" - Sheets("Dr Label").PrintOut
                    Application.ActivePrinter = "Brother MFC-8880DN Printer" - Sheets("Lining Rebated").PrintOut
            End Select
        End If
    End Sub
    Moderator's note: Please take the time to review our rules. There aren't many, and they are all important. Rule #3 requires code tags. I have added them for you this time because you are a new member. --6StringJazzer

    Thanks for the help in advance.
    Last edited by 6StringJazzer; 03-22-2017 at 11:20 AM.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Replies: 2
    Last Post: 01-11-2017, 12:24 AM
  2. [SOLVED] Runtime Error 9, open debug and macro completes
    By Aaron092 in forum Excel Programming / VBA / Macros
    Replies: 42
    Last Post: 11-03-2014, 10:09 AM
  3. why is this code returning error AFTER it completes
    By Muzza86 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 04-24-2014, 09:30 AM
  4. [SOLVED] preventing simple zoom macro from running step by step
    By reece1984 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 06-11-2012, 06:13 AM
  5. I need a drop down list that auto completes and filters at the same time
    By TranceDiablo in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 04-01-2011, 09:06 AM
  6. On error, go back a step in macro
    By girthhart in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 10-07-2008, 12:04 PM
  7. Still adding to Complex Macro...1 step at a time.
    By oberon.black in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 09-04-2005, 01:05 PM

Tags for this Thread

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