+ Reply to Thread
Results 1 to 2 of 2

Type Mismatch Error

Hybrid View

  1. #1
    Registered User
    Join Date
    05-31-2017
    Location
    Brunswick, ME
    MS-Off Ver
    2013 (work) and 365 (home)
    Posts
    70

    Type Mismatch Error

    I'm very new with VBA and am basically learning by trial and error.

    I'm trying to copy several non-contiguous ranges from one worksheet to another and then remove duplicates with one macro.

    I had set this up with the "Record Macro", but know that's very clunky, so I've tried to consolidate the code, but now I'm getting an "Error 13, Type Mismatch". Can someone help me understand what's not working (and then help me fix it)?

    Sub Consolidate()
    '
    ' Consolidate Macro
    '
    ' Keyboard Shortcut: Ctrl+Shift+K
    '
        Worksheets("Count").Activate
        Worksheets("Count").Range("A:AH").ClearContents
        Worksheets("RAW").Activate
        Worksheets("RAW").Range("A1:A50").Copy _
            Destination = Worksheets("Count").Range("A1:A50")
        Worksheets("RAW").Range("C1:D50").Copy _
            Destination = Worksheets("Count").Range("B1:C50")
        Worksheets("RAW").Range("G1:H50").Copy _
            Destination = Worksheets("Count").Range("D1:E50")
        Worksheets("RAW").Range("AG1:AG50").Copy _
            Destination = Worksheets("Count").Range("F1:F50")
        ActiveSheet.Range("A:F").RemoveDuplicates Columns:=Array(1, 2, 3, 4, 5, 6) _
            , Header:=xlYes
    End Sub

  2. #2
    Registered User
    Join Date
    05-31-2017
    Location
    Brunswick, ME
    MS-Off Ver
    2013 (work) and 365 (home)
    Posts
    70

    Re: Type Mismatch Error

    Herp-derp. I fixed it. Realize I was missing the colon after Destination!

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] RunTime Error 13 ( type mismatch ) error is comming TextboxAfter_Update
    By HaroonSid in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 05-04-2017, 03:55 AM
  2. Run Type error 13 Type Mismatch
    By Affan Khan in forum Excel Programming / VBA / Macros
    Replies: 15
    Last Post: 11-13-2012, 12:58 PM
  3. [SOLVED] Run-type error 13 type mismatch
    By misop in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 06-05-2012, 04:08 AM
  4. Complile Error: Type Mismatch ??? After adding error trap
    By clemsoncooz in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 02-22-2012, 03:50 PM
  5. Conditional Formatting - Run Time Error '13' Type Mismatch Error
    By ksp in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 11-17-2011, 07:37 PM
  6. Help: Compile error: type mismatch: array or user defined type expected
    By lvcha.gouqizi in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-31-2005, 05:05 PM
  7. VBA type mismatch error
    By Garbunkel in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 08-03-2005, 11:05 AM

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