Read variable number of columns in Excel Sheet and save in a variable

I’m trying to read an Excel file which has not a fixed number of columns but a variable number of columns.
I saved the number of total columns in an integer variable, which varies according to the used Datatable.
I would like to know:

  1. how I can extract the current number of column in the While Activity;
  2. how can I can READ only the column with the current column number;

I would like to use READ RANGE Activity to read the column variable because I need a DataTable variable to perform successive tasks.
Thank you in advance,

By Column Index colNo= TargheData.Columns.IndexOf(col)

1 Like

Thank you @vvaidya :grinning:
Is there a possibility to save only the COLUMN with the colNo index in a DataTable variable?
Thank you.

something like this? 1 is arbitrary column number


1 Like

Thanks so much @vvaidya.
It worked correctly.
Here I attach the screenshots.


Thank you so much.

1 Like