Hey guys its me again
I want to write a value at the end of a column, the number of row of the data is different from files, so I want to make the robot always write it at the end
This is how I get the value of each row
HI @Juandix
try this in assign
Currentrow(“Your column”) = Currentrow(“Your column”).Tostring + “Any value you want to add”
Ideally its better to read whole data into Datatable and then perform manipulations and write back
cheers
So this will write the number at the end of the column this is how my excel file looks
I want to write the info in column B row 11 but the size of the table changes everytime
Hi @Juandix
You want to write something at end of row or cloumn?
Can you show how the output looks so that it is more clear
cheers
Sorry for the confusion i mean at the end of the row i dont have anything in the output just the sum of the numbers in the collum b
Hi @Juandix
Ok no problem
So first read the data into datatable (dt) using the read range activity with headers property checked
Then use a write cell and give the cell value as follows for writing in B column at the end
“B” + (dt.rowcount+2).tostring
Basically its counting thw rows and adding 2 as there is one header at the top and we need to write in next line
Cheers
This is how I understood your solution
Hi @Juandix,
What about below
Col1 = YourColumnName
dt.AsEnumerable.Sum(Function (x) If(Double.TryParse(x.item(“Col1”).ToString, 0), Double.Parse(x.Item(“Col1”).ToString), 0)).ToString
Xaml
Sequence11.xaml (9.2 KB)
Range = “B”+(dt.RowCount+2).ToString
Best,
Rajkumar
Hi @Juandix
To be exact this is what you need to write
Excel.Sheet("Prueba").Cell("B" + (dt.rowcount+2).tostring)
Please make sure to replace inverted comma if you are copy pasting it
Hope this helps
cheers
Hi @Juandix
If this is fixed can you please mark the solution and close so that it helps others as well
If not happy to help
Cheers
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.