Update the sheet Cell Value

Hello Everyone,

How can we update the cell for each of the row value
Example
Name | Code
AX03 |
NX06 |

So it should return B2 for AX03

Current approach used is lookup data table which returns the row index of AX03
then write cell as “B”+(int_index).ToString

But this approach is not working in proper way so what can be changed

Thanks in advance:)

Hi @anmita

what about the following example?
if you want to find each row, put that application scope within a for each row activity and pass the currentRow value to the lookup range activity

Regards

Hi,

In this case, we can use LookupDataTable as you tried. Is there any problem?
The following is a sample for it. Can you check this?

Sample20230308-2L.zip (8.2 KB)

Regards,

Hi @anmita,

  1. Use the Read Range activity to read the data from the Excel file and store it in a data table variable called ‘dataTable’.
  2. Use a For Each Row activity to iterate through each row of the data table.
  3. Inside the For Each Row activity, use an If activity to check if the value in the ‘Name’ column matches the desired value. For example, you can use the following condition:row("Name").ToString = "AX03"This will check if the value in the ‘Name’ column of the current row is equal to “AX03”.
  4. If the condition is true, use the Write Cell activity to update the corresponding cell in the ‘Code’ column. You can use the following expression to get the address of the cell:"B" + (row.Table.Rows.IndexOf(row) + 2).ToString()This will get the index of the current row in the data table, add 2 to it (to account for the header row), and concatenate it with the column letter “B” to get the address of the cell in the ‘Code’ column.You can then set the value of the cell to the desired value (e.g. “B2”).

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