Logo 
Search:

MS Office Forum

Ask Question   UnAnswered
Home » Forum » MS Office       RSS Feeds

Help with duplicates

  Asked By: Pedro    Date: Jan 11    Category: MS Office    Views: 720
  

I am new to Formulars in Excel. I am trying to delete duplicates in
a colum where I used =A2&B2 to get the result and now I have
multiple duplicate entries that I want to delete.

I heard that there is an IF statement that I can use you delte
duplicates. But I don't know how to use it.

Share: 

 

1 Answer Found

 
Answer #1    Answered By: Gregg Bennett     Answered On: Jan 11

Here is some macro code that will delete  duplicate rows. Is that what
you want?

Sub RemoveDuplicates()
Dim totalrows As Integer

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

 
Didn't find what you were looking for? Find more on Help with duplicates Or get search suggestion and latest updates.




Tagged: