How to copy paste the last entire column in the lastcolumn+1 th column.
How to copy paste the entire column by finding the last column index
Check on the below thread and also direct expression is yourDatatable(yourDatatable.Columns.Count - 1)
This is used for finding the last column index but i want to copy the entire last column data in lastcolumn +1th index
→ Use read range workbook activity to read the excel and store in a datatable called dt.
→ Then use the below one to get the column count
Columncount = dt.ColumnCount
→ Then you can write range workbook activity to write the last column to excel.
Hope it helps!!
ColIndex = Excel.Sheet("Sheet1").DataTableValue.Columns.Count
LastCol = UiPath.Excel.Helpers.ExcelUtilities.ConvertColumnIndexToColumnLetter(ColIndex)
NewCol = UiPath.Excel.Helpers.ExcelUtilities.ConvertColumnIndexToColumnLetter(ColIndex+1)
Regards,
1 Like
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.
