Put Excel Loop in Stata
<p>I am trying to extract values incorporated in a Forvalues "Loop" from Stata to Excel. </p>

<pre><code>forvalues i = 20(5)40 {

forvalues x = 0(5)10 {
local xlsrow = 2
putexcel A`xlsrow'=("`i'_`x'") using results, sheet("individuals") modify

local xlsrow = `xlsrow'+4               
}
}
</code></pre>

<p>In the first stage I just want to write the different combinations of the variables i &amp; x into the column A. Unfortunately, the only result I receive is the last combination 40_10 in row A2. So somehow, I must have a problem in the local xlsrow, but I am unable to figure it out. Help is highly appreciated!</p>