VB Script to remove duplicate records

Hi Team,

Can anyone please help me VB script code to delete the Duplicate records in excel.

Actually I already have one code which works in macro but its giving me error in our VB script plugin.

Below is the code which is working in macro

Sub Duplicate()

Workbooks.Open (“FilePath”)

Range(“A1:T20000”).RemoveDuplicates Columns:=2, Header:=xlNo

ActiveWorkbook.Save

ActiveWorkbook.Close

End Sub

Hi Tanmay.
Do not know what you are project is about. If writing to excel and you want to remove duplicates, I would use the AE plugin Unique Rows. Much more efficient the going with VB.
Hope this helps.

Hi Wllmdjngh,

I cant use unique rows as to use unique rows the coloumn has to be sorted. and I can’t sort the rows. so I am preferring VB Script.

Hi Tanmay

go through this once for your reference
Thank you