Niraj Baraili
Member
Hi Experts,
I found a code in below link for deleting duplicate rows using dictionary method. But i am not able correlate these lines - "Application.Index(sn, j, 0)" and "Application.Index(.items, 0, 0) " . Hope someone will put some light on it.
http://www.snb-vba.eu/VBA_Dictionary_en.html#L_22
I found a code in below link for deleting duplicate rows using dictionary method. But i am not able correlate these lines - "Application.Index(sn, j, 0)" and "Application.Index(.items, 0, 0) " . Hope someone will put some light on it.
http://www.snb-vba.eu/VBA_Dictionary_en.html#L_22
Code:
Sub M_delete_duplicates()
sn = Sheets("Sheet1").Cells(1).CurrentRegion.resize(,5)
With CreateObject("scripting.dictionary")
For j = 1 To UBound(sn)
.Item(sn(j, 1)) = Application.Index(sn, j, 0)
Next
Sheets("Sheet1").Cells(1, 4).Resize(.Count, UBound(sn, 2)) = Application.Index(.items, 0, 0)
End With
End Sub