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
Robust option in a ols modelHi everyone, I was wondering if one can use robust option in a ols regression model that includes bo…
How to extract one variable from a string?We have a dataset of different movies but genres contain more than one variable. For example, under …
How do I create a constant sample of firmsHi, I would need some help with the following problem please, I'm a new STATA user: I have a list o…
How to deal with error correlation model with Stataregression function is : Array Array In the following data, variable value is the value of 1952,…
duplicates tag in a foreach loopHello everyone. I am trying to make this loop run but it keeps on giving me { required r(100). I am…
Subscribe to:
Post Comments (Atom)
0 Response to Looping increasing cellranges and importing to stata
Post a Comment