I have an Excel sheet, and it has many columns (say column A through column Z).
We know the name of the columns, or the name of the last column. However, we don’t know how many rows there are in this table, as it varies each time.
Now I want to read the datatable from this table, but I want to remove any columns after column S, and it should not be included in the datatable.
How could do I achieve this in Read Range Activity?
Hi @tomato25
You should be able to achieve this through the data table filter wizard where you can be specific about which columns are required. You will have the same option for rows also. As for knowing how many rows of data you can capture this in a variable using the following datatablename.Rows.COUNT
Good luck
Paul
Hope you have a datatable Variable named outdt
–while before trying to use that variable any where which has all the columns…we need to get only the columns until column-S, like this
O Finaldt = outdt.DefaultView.ToTable(False, “column-A”,“column-B”,“column-C”,…“Column-S”)
This will give only the datatable with columns till column-S, where the Finaldt is a variable of type datatable