Write variable text in Excel cells, one by one with COUNTER

studio

#1

Hi all!

I’m getting a text with regex and it’s stored in Value variable. It’s inside a For Each activity and what I want is to write each value of Value variable in cell below of excel.
Something like this:
1

The Counter value is initialized in 0 but it doesn’t increment for each Variable value.
How can I solve this?

Regards,
J.


Copying a marked text with hotkeys
#2

Few inputs

Counter should be of type int

to increment do Counter = Counter+1 (not Counter + “1”)

in the write cell -> “A”+ Counter.ToString


Copying a marked text with hotkeys
#3
"A"+Counter.ToString

Think you had a typo :slight_smile:


#4

Also check the scope of Counter variable.
If it’s inside the loop, it will get out of scope and reinitialized with each iteration:

Like this (what you’re probably getting):

Instead of what you want, like this:


#5

Thanks all! All answers help me to achieve it! :smiley: