[Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

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

Posted on 2015-02-04
3
Medium Priority
?
116 Views
Last Modified: 2016-02-10
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

0
Comment
Question by:kbay808
  • 2
3 Comments
 
LVL 50

Accepted Solution

by:
Martin Liss earned 2000 total points
ID: 40589378
Add this line changing the parameters as appropriate.

ActiveSheet.Range("A1:C100").RemoveDuplicates Columns:=Array(1,2), Header:=xlYes
0
 

Author Closing Comment

by:kbay808
ID: 40590158
That worked!!!  Thank you very much
0
 
LVL 50

Expert Comment

by:Martin Liss
ID: 40590175
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

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Use Windows Task Scheduler to print a Word document weekly so your printer ink won't dry out.
Windows Explorer lets you open cabinet (cab) files like any other folder. In VBA you can easily handle normal files and folders, but opening and indeed creating cabinet files takes a lot more - and that's you'll find here.
The viewer will learn how to create a normally distributed random variable in Excel, use a normal distribution to simulate the return on an investment over a period of years, Create a Monte Carlo simulation using a normal random variable, and calcul…
This Micro Tutorial will demonstrate on a Mac how to change the sort order for chart legend values and decrpyt the intimidating chart menu.

865 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question