Creating an array with list of names in Excel

excel
activities
variable
string

#1

I know this should be very simple, but I cannot find out how to create an array (string) of names using a list of names in Excel. Attached is the excel file with the names. I am hoping to store the names in an array and then search for each of the names in a text file using the for each loop.

Thanks for the help.LastNames.xlsx (9.4 KB)


#2

Hi.

I know you can do this with LINQ using .Select()

It would look like this:

dt1.AsEnumerable.Select(Function(row) row("column").ToString.Trim).ToArray

You can also manipulate the string if you choose by changing the value inside the Select()
You can also take only unique values by adding .Distinct after the Select

Regards.