[Webinar] Streamline your web hosting managementRegister Today

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 609
  • Last Modified:

Quick way to remove duplicates with VBA

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
Jagwarman
Asked:
Jagwarman
  • 3
  • 2
1 Solution
 
Rgonzo1971Commented:
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
 
JagwarmanAuthor Commented:
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
 
JagwarmanAuthor Commented:
Rgonzo1971 did you see my post to you Re:

search for text in a file in a folder from an open file
0
 
Rgonzo1971Commented:
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
 
Rgonzo1971Commented:
Hi,

For the other question, could you open a new question

Regards
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now