How to append the column after the last column and their values which are saved in a variable. How to append them after the count of columns.
Hi Priya,
Use a For Each Loop. Then using Write Cell activity, you can specify the sheet name and in the range specify the row Name with Index counter.
For Ex: A1 cell means A column 1 row. in place of first row, use Index and then assign index = index+1
In write cell, you can provide the variable name.
Let me know if it helps.
the columns are not fixed.How to append after the last column
If you are trying this with Excel activities then use Read Range activity inside Excel Scope this will give you DataTable.
intLastColumn = dtExcel.Columns.Count+1
This will give you last column.
Use this code to get column letter.
strColLetter = UiPath.Excel.Helpers.ExcelUtilities.ConvertColumnIndexToColumnLetter(intLastColumn )
Column header cell
strCell = strColLetter +"1"
Rest data you can write by changing the row number as per your logic.
like strColLetter +"2"
strColLetter +"3"
etc.
Thanks,
Ashok
I have used modern activities write cell
Select Custom Input
for property Where to write
and pass the last column range we prepared.
- Where to write - Click Plus on the right side of the field and then, from the menu, select an Excel file and a named cell where to enter the data, or select Indicate in Excel to indicate directly from the file. Alternatively, you can select Custom Input to enter a cell address manually, or Open in Advanced Editor to enter a VB expression.
Thanks,
Ashok
rows are also not fixed
ok but there would be some logic right where you want to write the data. Implement the logic to identify which row needs to be updated and combine ColumnNumber + RowNumber
and this would be your destination cell to write.
Thanks,
Ashok
how to add this in write cell modern activity
Hi ,
->Read the DataTable
→ Use an Assign
activity to get the column count.
→ Use the Add Data Column
activity to add a new column.
->Use a loop to populate values into the new column.
CurrentRow.Item(columncount) = values to place
how to get the strcolname and rownumber
Here I have explained the logic.
But if you want to enter at any other cell use this in where to write
Excel.Sheet("Sheet1").Cell("A4")
Thanks,
Ashok
I didnt get the proper values
What values you didn’t get. What was expected and what is getting and what are the cell you are looking into?
in this, I have to get the values at j beside of quantity but I am getting the values beside of june23
Ok. What’s the logic you are using to retrieve it?
same as this
You can try the below workflow for this,
Regex_Practice.xaml (41.2 KB)
Hope it helps!!
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.