Add row values to an array (uniquely)

Hey everyone,

I have an excel sheet which I want to take values under a column and add it to an array for further processing. The trick is under these columns most values are duplicates. So for example.

Column:
123
12
11
123
5
11

I want to add 123,12,11,5 to the array, I dont want the same value to be added twice to the array, there should be 1 of each column values.

How can I achieve this?

You can add all values to a hash-set to get distinct values. Afterwards you can convert it to an array if needed.

@berkaykor
have a look here:

for the integers it is assumed that each value is also parseable, otherwise we should handle the exceptions.

find demo xaml here:
DT_1Col_to_Array.xaml (7.3 KB)

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.