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

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 602
  • 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

[Webinar] Cloud and Mobile-First Strategy

Maybe you’ve fully adopted the cloud since the beginning. Or maybe you started with on-prem resources but are pursuing a “cloud and mobile first” strategy. Getting to that end state has its challenges. Discover how to build out a 100% cloud and mobile IT strategy in this webinar.

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