Forum home » Delegate support and help forum » Microsoft VBA Training and help » vba courses london - Duplicates
vba courses london - Duplicates
Resolved · Low Priority · Version Standard
Duplicates
How can you remove duplicates from a excel sheet and before sorting data into a VBA project?
For upcoming training course dates see: Pricing & availability
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
|
