I am importing 35 sheets from 35 excel files. The naming of excel sheets is such that only few digits change across all these files. I am running a loop for this. Please see the code below.
Code:
*Importing files local varlist "Andhra Pradesh" "Assam" "Bihar" "Chhattisgarh" ......"Andaman and Nicobar Islands" "Lakshadweep" local sheets "Village_Data_0100" "Village_Data_0200" ....."Village_Data_3500" foreach x in varlist { foreach i in sheets import excel "pathname\`x'.xlsx", sheet("`i'") firstrow case(lower) clear }
Can someone please tell me where am I going wrong ?
Thanks.
0 Response to Importing multiple sheets from multiple excel files using loop
Post a Comment