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
Bookmarks