clear dublicate values

  • Thread starter Thread starter bijan
  • Start date Start date
B

bijan

Hi all,
I have a datasheet like this:
field1 field2 field3
AA 100 10
AB 100 15
BB 200 10
BA 200 20
I need a vba code to clear one or more of dublicate numbers( just in field2)
and after run it, my datasheet become like this:
field1 field2 field3
AA 100 10
AB 15
BB 200 10
BA 20
any help would be appreciated
 
Sub deletedups()
mc = "b"
For i = Cells(Rows.Count, mc).End(xlUp).Row To 2 Step -1
If Cells(i - 1, mc) = Cells(i, mc) Then Cells(i, mc).ClearContents
Next i
End Sub
 
Back
Top