Copy cell value to another cell in the same row if new cell is empty

Good Day. Is there a way for me to copy a value from a cell to another cell in the same row if the new cell is empty. I am currently using a for each row activity with an if statement inside it that then checks if the cell is empty then assigns the former cell value to the later cell. But my issue is that i have a datatable with 20000 rows and so it is taking a lot of time to compute. Is there a way that i could use that maybe includes a linq query so that it takes less time.

What happens if the new cell is not empty?

Col1 col2 col3
x y z
a b
What do you want this to look like?

1 Like

If the new cell is not empty i would like to leave it as is. Like below
Col1 col2 col3
x y z
a b a

is col3 always = col1? even when col 3 is not blank, for example:

col1 col2 col3
x y x
a b

Also, how many of the records have the blank

No, col 3 is only equal to col 1 when col 3 is initially empty.
col1 col2 col3
a b c
x y

The above table becomes:
col1 col2 col3
a b c
x y x

I would say 3/4 have the blank

Thanks for the info. I was thinking of trying to extract the rows to change if it was significantly less-but not sure that would help.

Maybe something in LINQ, hopefully one of the robot masters sees this soon and an help.

1 Like

I saw this post on another topic and perhaps it can help. See the file provided by Priyanka_Ramesh. Looks like it can be edited for your scenario.