Going to a dynamic Table's Last Row and Pasting in Excel

Hey Everyone,

I am automating an activity where the bot goes to the bottom of a datatable copies the last row and pastes it into excel.

Now the no.of rows in this data table changes everyhour. So I want to bot to go the last row and copy the row and paste it into Excel. The bottleneck is I am unable to extract the text and define the selector dynamically.

Kindly Assist on the same.

Hi,

You can do that using yourDataTable.Rows.Count-1 to get the data from the last row all the times.

How do I paste into excel ?

You can use Write Range activity, Let us know what are all the data you want to get from the last row and write it into the new excel

I want to capture the row value (from the last row) in third column from the datatable and paste it into the excel.

Also to extract the data, which activity should I use ?

If you need only the third column from the last row, then in an assign activity for a string variable you can assign the value as

yourDataTable.Rows(yourDataTable.Rows.Count-1)(2).ToString
1 Like