2008年3月3日 星期一

Deleting duplicate data with Advanced Filter


The following code will delete duplicate data for each column.
Sub test()
For i = 1 To 6
Set myData = Range(Cells(1, i), Cells(7, i))
Set myCrit = Range(Cells(9, i), Cells(10, i))
Set myDest = Range(Cells(13, i).Address)
myData.AdvancedFilter Action:=xlFilterCopy, CriteriaRange:=myCrit, CopyToRange:=myDest, Unique:=True Next i
End Sub

沒有留言: