Hi, I have a row “ID” in a table. Now I read a value from a program and I need to insert that value in the first empty field in “ID”. How could I do that?
Read the Excel into Data Table using Read Range Activity under Excel Application Scope.
Loop thru each row and find the empty ID row. Place a counter inside the for loop to find the empty row index.
Counter = 0
foundRow = 0
For Each row in DataTable
Counter = Counter + 1
if row(2).ToString = "" Then
foundRow = Counter
Break Loop
End if
End For
Use Write Cell Activity, with address "C" + foundRow.ToString
If you have headers included while reading Excel ,use address "C" + (foundRow+1).ToString
If you want all the list of empty rows,
in place of foundRow, use an array to store all the row numbers and then use this array to insert IDs into empty ID column.