How to get row index by knowing column value

This is my excel, i know columnC value, using that i need to add value to column G
How can i do that

@anishakotian400

For Each row In YourDataTableVariable
If row(“ColumnC”).ToString() = “KnownValue” Then
row(“ColumnG”) = “NewValueToAdd”

@anishakotian400

  1. Read Data:
  • Use the “Read Range” activity to read data from Excel/CSV into a DataTable.
  1. Loop Through Rows:
  • Use a “For Each Row” activity to go through each row in the DataTable.
  1. Check ColumnC Value:
  • Inside the loop, use an “If” activity to check if the value in ColumnC matches your specified value.

plaintextCopy code

Condition: row("ColumnC").ToString = "YourSpecifiedValue"
  1. Update ColumnG:
  • Inside the “Then” branch of the “If” activity, use an “Assign” activity to add a value to ColumnG.

plaintextCopy code

Assign: row("ColumnG") = "YourNewValue"
  1. Write Data:
  • After the loop, use the “Write Range” activity to save the modified DataTable back to Excel/CSV.

@anishakotian400

if you want to find the index of the row having the column value
use the below expression

dt.AsEnumerable().tolist.FindIndex(Function(a) a("ColumnName").tostring.trim.equals("Your Value"))

@anishakotian400

As it is excel, Simplest would be to use find/replace activity which would give you the cell number in which you foudn the value you want to search in C

Then use write cell with range as Excel.Sheet("SheetName").Cell("G" + findreturnvalue.Replace("C",""))

If using classic then cell value would be only "G" + findreturnvalue.Replace("C","")

Hope this helps

Cheers