How to add remove duplicates to my copy, sort and paste macro?

Public Sub CopySort()
    Sheets("Lists").Range("R2:Y33").Copy
    ActiveSheet.Range("A20").PasteSpecial Paste:=xlValues, Operation:=xlNone, SkipBlanks:= _
    False, Transpose:=False
    Selection.Sort key1:=Range("A20")
End Sub

Open in new window

kbay808Asked:
Who is Participating?
 
Martin LissOlder than dirtCommented:
Add this line changing the parameters as appropriate.

ActiveSheet.Range("A1:C100").RemoveDuplicates Columns:=Array(1,2), Header:=xlYes
0
 
kbay808Author Commented:
That worked!!!  Thank you very much
0
 
Martin LissOlder than dirtCommented:
You're welcome and I'm glad I was able to help.

In my profile you'll find links to some articles I've written that may interest you.
Marty - MVP 2009 to 2014
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.