Hi everyone
ı deeply searched about my problem but ı couldnt find a solution.
Here is my problem about importing from excel.
ı have 21 sectors and 132 monthly excel files. I want to import for every sector(j) with different cell range. cell range begins with cellrange(A15:I19) for the first sector and row increases by 7, column increases by 7. but ı cant put these increasing cell ranges to loop.
First sector j=1 cellrange(A15:I19)
Second sector j=2 cellrange(A22:I26)
forval j= 1/21{
forval i= 1/132{
import excel using C:\Users\a`i'.xls, sheet(blabla) cellrange(A15:I19) clear
gen sectorid = `j'
gen time = `i'
save s`j'`i'.dta,replace
}
}
thanks for your kindly response.
Related Posts with Looping increasing cellranges and importing to stata
multiply vectors; dot productThis is probably very easy, but I don't know how to do it. 1) If part1, part2, part3 in the example…
No observation error when creating new variablesDear Stata users! I am having a problem and looking forward to your help. You can see one part of m…
Panel Regression Help!!Hi all!! Firstly, thank you for reading/helping! I'm attempting a project on looking at CEO persona…
Marginal Effects after FirthlogitDear Statalists, I have used mfx command after estimating firthlogit model, and the predicted Y sho…
Removing Compound Quotes in Local MacroI am using levelsof to feed a list of ISO-3 country codes into wbopendata to query countries' GDP fr…
Subscribe to:
Post Comments (Atom)
0 Response to Looping increasing cellranges and importing to stata
Post a Comment