Hi Team,
I generated some multiple files namely: form_geninfo form1_hhmembers form2_plots form3_cropranking_main form3_cropranking_spouse form20.
so I am trying to export the files into excel workbook each dataset into its sheet. See the section of script below i wrote to loop and write each dataset in each worksheet:
...
local mylist form_geninfo form1_hhmembers form2_plots form3_cropranking_main form3_cropranking_spouse form20;
foreach x of local mylist{;
export excel using data.xls,sh("`x'");
};
Its working well looping naming each sheet as expected but the challenge am facing is that its picking the last dataset "form20" and writing in all the worksheets instead of each dataset in its sheet.
Please what could I be wrong in the above code? Any idea would be highly appreciated.
Collins
I generated some multiple files namely: form_geninfo form1_hhmembers form2_plots form3_cropranking_main form3_cropranking_spouse form20.
so I am trying to export the files into excel workbook each dataset into its sheet. See the section of script below i wrote to loop and write each dataset in each worksheet:
...
local mylist form_geninfo form1_hhmembers form2_plots form3_cropranking_main form3_cropranking_spouse form20;
foreach x of local mylist{;
export excel using data.xls,sh("`x'");
};
Its working well looping naming each sheet as expected but the challenge am facing is that its picking the last dataset "form20" and writing in all the worksheets instead of each dataset in its sheet.
Please what could I be wrong in the above code? Any idea would be highly appreciated.
Collins
Comment