I know the title is hard to understand, so let me elaborate on this.
I have an excel sheet with data like the following.
As you can see, there are lots of space under Name column.
But you can easily tell A3 through A5 are also of Michael’s.
Likewise, A7 is of Tony’s, A9 through A11 are of Kevin’s, and so on.
I used Read Range and retrieved a DataTable object from it, but it has, of course, spaces where it has spaces in the Excel sheet. Now I want to somehow modify the DataTable object so the result of Write Range from the DataTable object will look like below:
I don’t know about elegant, but you will want to run the rows through a ForEach loop. Then, you can use an If activity to check for empty values, and if it is not empty then store to another variable to be used to assign to the empty cell.
Here is some pseudocode:
Declare variable previousName
For each row in dt1
If activity: condition: row("Name").ToString.Trim = ""
Then Assign activity: row("Name") = previousName
Else Assign activity: previousName = row("Name").ToString