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
Generating new variableHey stata community, How can I generate a new variable that tells me how frequent a product is per …
Keeping specific values from a tabDear Statalist, I am wondering if it is possible to know automatically the value for the 5 minus the…
Run GLS for panel data with (N=816 and T= 8)Hello I run OLS for my panel data ( with N=816, T=8) and check heteroskedasticity as below : Code: …
Deadlock in StataDear All, I wonder why the following code causes Stata to stop responding to the BREAK button in th…
The coefficient of my dynamic dependent variable is negativeDear Stata users, I am estimating a dynamic model of y = f(y_1 x1, x2, x3) using GMM. the coefficie…
Subscribe to:
Post Comments (Atom)
0 Response to Looping increasing cellranges and importing to stata
Post a Comment