Delete last column and row in excel

Hello! I need delete last column and later the 2 last row in excel file. But they always be on difference place.

For example, I can create DT, and then?


  1. Use Insert/ Delete Rows activity to delete rows.

  2. Use Insert/ Delete Columns activity to delete columns.

1 Like

To delete the last column use REMOVE DATACOLUMN activity once after getting the datatable variable from read range activity named dt

In Remove Datacolumn activity mention the datatable name as dt and column index as dt.Columns.Count-1

And similarly for Datarow use REMOVE DATAROW ACTIVITY
Where for last row mention RowIndex as dt.Rows.Count-1

And for last before row mention as dt.Rows.Count-2

Cheers @RPA3


This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.