Putexcel issue
Dear Statalister,
I have a issue of the following code. When I run the code it works for the first item in the "foreach X of newlist", which is "lf". It does not give any error message. So it creates excel sheet "num_lf". But I need same thing for other items in the list (ov, tr, sth, sch). Can somebody help me to fix the problem.
Thanks.
Nizam
************************************
use $analysis\output\disease_long,clear
keep if inrange(year,14,17)
local k=4
local i=1
foreach X of newlist lf ov tr sth sch {
putexcel set "$analysis\output\disease_test1", sheet(num_`X') modify
while `i'<=11 {
mkmat cc year trt_`X'_all_m trt_`X'_all_f trt_`X'_tot pop_m_ pop_f_ pop_ ///
if cc==`i', matrix(num`i')
putexcel B`k' = matrix(num`i'), hcenter font(arial,9,black)
local i=`i'+1
local k=`k'+5
}
}
0 Response to Putexcel issue
Post a Comment