Hello,
I want to export the "auto" file in several Excel's sheets (one per brand).
Code:
sysuse auto, clear
* brand
generate splitat = strpos(make," ")
gen brands=substr(make,1,splitat-1)
gen models=substr(make,splitat+1,10)
* export
levelsof brands, local(brand)
foreach brands in `brand' {
export excel using "c:\sysuse_by_brand.xlsx", firstrow(variables) sheet(`brand') sheetreplace
}
Obviously there is an "invalid sheet() option" problem. I can’t find it.
Thanks for your help !