Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Quick way to remove duplicates with VBA

Posted on 2014-01-21
5
Medium Priority
?
592 Views
Last Modified: 2014-01-21
I have trolled through EE and various other sites to find a definitive way to remove duplicates with VBA code but they all seem to take forever to complete, reason being that my spreadsheet has over 200000 rows.

Can any expert provide me with VBA code that will quickly remove duplicates from column A in my spreadsheet.

Thanks
0
Comment
Question by:Jagwarman
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
5 Comments
 
LVL 53

Expert Comment

by:Rgonzo1971
ID: 39796447
Hi,

pls try Data / data Tools / Remove Duplicates and select the column you want

or like this

ActiveSheet.Range("$A$1:$B$7").RemoveDuplicates Columns:=1, Header:=xlNo

Open in new window



Regards
0
 

Author Comment

by:Jagwarman
ID: 39796557
It's not until I get a reply sometines that I realize I should have been more specific.

I need to find the duplicates in column A but remove the entire Row.

Sorry.
0
 

Author Comment

by:Jagwarman
ID: 39796560
Rgonzo1971 did you see my post to you Re:

search for text in a file in a folder from an open file
0
 
LVL 53

Accepted Solution

by:
Rgonzo1971 earned 2000 total points
ID: 39796562
HI,

pls try
    ActiveSheet.Range(Range("A1"), Cells(Range("A" & Cells.Rows.Count).End(xlUp).Row, Cells(1, Cells.Columns.Count).End(xlToLeft).Column)).RemoveDuplicates Columns:=1, Header:=xlNo

Open in new window

Regards
0
 
LVL 53

Expert Comment

by:Rgonzo1971
ID: 39796588
Hi,

For the other question, could you open a new question

Regards
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

In Part II of this series, I will discuss how to identify all open instances of Excel and enumerate the workbooks, spreadsheets, and named ranges within each of those instances.
This article describes how to use a set of graphical playing cards to create a Draw Poker game in Excel or VB6.
This Micro Tutorial demonstrates using Microsoft Excel pivot tables, how to reverse engineer competitors' marketing strategies through backlinks.
This Micro Tutorial will demonstrate in Google Sheets how to use the HYPERLINK function to create live links inside your spreadsheet.

650 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