Public Schedule Face-to-Face & Online Instructor-Led Training - View dates & book

vba courses london - duplicates

Forum home » Delegate support and help forum » Microsoft VBA Training and help » vba courses london - Duplicates

vba courses london - Duplicates

ResolvedVersion Standard

Duplicates

How can you remove duplicates from a excel sheet and before sorting data into a VBA project?

RE: Duplicates

try this code

Sub RemoveDuplicates()

Cells.Sort Key1:=Range("A1")
totalrows = ActiveSheet.UsedRange.Rows.Count
Count = 1
For Row = totalrows To 2 Step -1
If Cells(Row, 1).Value = Cells(Row - 1, 1).Value Then
Rows(Row).Delete
Count = Count + 1
End If
Next Row

End Sub


If you

 

Training courses

Training information:

Welcome. Please choose your application (eg. Excel) and then post your question.

Our Microsoft Qualified trainers will then respond within 24 hours (working days).

Frequently Asked Questions
What does 'Resolved' mean?

Any suggestions, questions or comments? Please post in the Improve the forum thread.

Connect with us:

0207 987 3777

Call for assistance

Request Callback

We will call you back

Server loaded in 0.1 secs.