Logo 
Search:

MS Office Answers

Ask Question   UnAnswered
Home » Forum » MS Office       RSS Feeds
  Question Asked By: Pedro Silva   on Jan 11 In MS Office Category.

  
Question Answered By: Gregg Bennett   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

Share: 

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


Tagged: