How to read last column of excel?

Hi,

I need to read the last column in excel, copy the values and paste into another excel.

I tried using read range workbook activity and it works if I specify the column range I want. however, my column range will change daily, and I need to know how this can be done. able to assist?

Hi @Mastura_Azman
You can read all file to get data table as dt1
to get last columns in data table you can use dt1.ColumnCount
to get alphabet you can use UiPath.Excel.Helpers.ExcelUtilities.ConvertColumnIndexToColumnLetter(dt1.ColumnCount)
read only last column you can
UiPath.Excel.Helpers.ExcelUtilities.ConvertColumnIndexToColumnLetter(dt1.ColumnCount) +“1” +“:” +UiPath.Excel.Helpers.ExcelUtilities.ConvertColumnIndexToColumnLetter(dt1.ColumnCount) +dt1.RowCount.ToString
my test
image
regards,

@Mastura_Azman Welcome to UiPath community

       If you know the column name you can use below code 

       Assign dt = dt.DefaultView.ToTable(False,"YourLastColumnName")