Select rows in columns for each


#1

Hi guys.

I’m having an issue i just can’t wrap my head around.

I’m trying to run a process in a for each loop where i copy the value in cell A1 in first loop, A2 in second loop etc and saving the value in a datatable and using get row item to send my value to a webtable. My process is running perfectly, but i need to bring one more cell in play for each loop.

How can i make my for each loop copy cell A1, save to a variable AND copy cell B1, and save to a variable in first loop - then in the second loop copy cell A2 and B2 and so on for each loop i’m running?

Thanks. :slight_smile:


#2

Hello @vovivo,

I’ve attached a zip file where I have done what I believe you wished for.

Cheers.
forEach.zip (7.8 KB)


#3

Awesome. Exactly what i was looking for.

Just to make sure i understood correctly: In your example i will be able to assign i new variable (varC) to row(2).ToString if i need it right?

Thanks.


#4

Yep :slight_smile:

You can also do row(“NameOfTheColumn”).ToString as long as your Read Range activity has “Add Headers” checked.

You are most welcome.