Creating variables from contents of Datatable

Hi guys,
Hoping somebody out there can assist. I have an Excel file with one column of data. I want to pass this data to a datatable and then for each row I want to temporarily assign the contents of the row to a string variable.
Currently when I am doing this, it assigns the whole range (after using Read Range) to the variable. I want to assign each row to a variable, then call this variable in another part of the project (perform an operation with this value)… then go back and get the next row and assign that to the variable and so on…
I have tried the for each item and the for each row activities but the variable just gets assigned all the contents of the datatable.

Any help is appreciated - thank you in advance.


You can try to insert each into an array or list right

Sorry - list right?

You can do like this:

  • Read Range (to DataTable: dt)
  • For Each Row
    • Use the values as row(0).ToString
1 Like

Unfortunately when i put in that code, and assign that to the variable, it doesnt recognize that each row should be a variable, it just puts all the contents of each row to that variable.