Dear all,
I am trying to run a loop that will import several sheets within a file. Each sheet has a different name and these names often have spaces within them. I am having trouble figuring out the correct syntax to use in the local and loop. This is what I am trying to do:
local municipio "Santo Domingo Este" "Santo Domingo Oeste" "Santo Domingo Norte" ///
"Boca Chica" "San Antonio De Guerra" "Pedro Brand" "Los Alcarrizos" "Azua"
foreach i of local municipio {
import excel "$raw/population_data.xlsx", cellrange(A7:G61) sheet("`i'") firstrow clear
}
Thank you in advance.
I am trying to run a loop that will import several sheets within a file. Each sheet has a different name and these names often have spaces within them. I am having trouble figuring out the correct syntax to use in the local and loop. This is what I am trying to do:
local municipio "Santo Domingo Este" "Santo Domingo Oeste" "Santo Domingo Norte" ///
"Boca Chica" "San Antonio De Guerra" "Pedro Brand" "Los Alcarrizos" "Azua"
foreach i of local municipio {
import excel "$raw/population_data.xlsx", cellrange(A7:G61) sheet("`i'") firstrow clear
}
Thank you in advance.
Comment