How to find duplicate count in each column and paste next sheet in excel

Hi Guys,

I have used below code,

(From p In DT1.AsEnumerable() Group By x= New With { Key.a =p.Item(item)} Into Grp = Group Select DT1.Clone.LoadDataRow (New Object() {grp(0)(0).toString+" Count is "+grp.Count.toString},False)).CopyToDataTable

I got a output in below ,


but i need below format


I attached Full code also,

Please any one help this

Dup (9.0 KB)

Raja G

Hi @Raja.G,

I have tried your use case, Please have a look and test it.

DistinctCount.xaml (16.5 KB) test.xlsx (9.9 KB)


1 Like

Thanks you ,I I’ll test