Bookmark and Share

Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

st: putexcel with a loop


From   Nick Bornschein <[email protected]>
To   "[email protected]" <[email protected]>
Subject   st: putexcel with a loop
Date   Tue, 18 Feb 2014 14:29:27 +0100

Hello,

I created an Excel file called "deskriptiv" with labels etc. and now I want to put the results from summarize commands into loop to put it in excel. Therefor I created:

foreach x of varlist koerper1-eltern4 {
        su `x'
        putexcel B2=rscalars using deskriptiv, sheet("deskriptiv") modify
}

The thing is: I need to modify B2 so that the "su koerper1" results will be put in B2 (and below) but the next "su koerper2" should be put in C2 and below. How do I get that? I tried something with [_n] but it does not work.

Best
-Nick
*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/faqs/resources/statalist-faq/
*   http://www.ats.ucla.edu/stat/stata/


© Copyright 1996–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index