I have to get the last column header and last row count and use delete range to delete the values in Excel.
I have got the last row value count using the below.
valueDT.Rows.count
When i tried to get the column header (A, B, C, D…I), it returns the count as “9” instead of “I”
I used this “valueDT.Columns.Count”
Please explain me how to get column header and use delete range to delete the cell value.
And also would like to know how to delete the entire sheet data?
I need the Column index as "A/B/C/D/… " or say whatever.
ValueDT.Columns(ValueDT.Columns.Count-1).ColumnName.ToString
The above returns the result as Column8.
I have the data in excel say 27 rows (including headers). To get the last row count, i will use valueDT.Rows.Count
I’m not clear with the -1 of count (last row index position). When i use this ValueDT.Rows.Count-1
It returns 26
This is total no of rows in a datatable
That’s correct
I mentioned that in addition for a knowledge that in order to get the last row index we need to include -1 as
index starts from 0 for first row
Count starts from 1 for first row
How can i achieve to print the last row of last column value in output panel.
I tried this,
Excel_Datatable.Rows(Excel_Datatable.Rows.Count-1)(Get_Column).ToString
where Excel_Datatable is the datatable name and Get_Column returns right bottom cornor value UiPath.Excel.Helpers.ExcelUtilities.ConvertColumnIndexToColumnLetter(Excel_Datatable.Columns.Count)+Excel_Datatable.Rows.Count.ToString