In Excel How we can add the data into to specific row

I have an Excel which contains some Currency Rate data & I have some data into multiple variables and enter the data into “Exchange rate” column of Below Excel,

Please help me How we can do that ?

You can use Vlookup activity to find the Cell row and then use write cell activity to replace that specific value in excel

@Ajinya_jorwekar

  1. Read Excel Data: Use the Read Range activity to read the data from the Excel file into a DataTable variable.
  2. Update Data: Assuming you have your currency rate data stored in variables (let’s say CurrencyRateVariable), use the For Each Row activity to loop through each row of the DataTable.
  3. Assign Activity: Inside the loop, use the Assign activity to update the “Exchange rate” column in the current row of the DataTable.
row("Exchange rate") = CurrencyRateVariable
  1. Write Excel Data: After updating the DataTable, use the Write Range activity to write the updated DataTable back to the Excel file.

                                            or 
    

in one line of code:

dt.AsEnumerable().ToList().ForEach(Sub(row) row("Exchange rate") = CurrencyRateVariable)

cheers…!.

By using for each row in Data Table, it is updating same value in every row of Exchange Rate column.
But I have separate value for each currency in string variable and I have to update it with new values. how we can do that ?

@Ajinya_jorwekar

its better to make all the variables values into an array

and use for each row in datatable activity and create output as index for that activity

inside use

assign activity

currentRow(“ColumnName”)=arrar(index)

outside of for each row in datatable use write range activity

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.