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



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:

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


Copying a marked text with hotkeys

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

Think you had a typo :slight_smile:


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:


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