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
generate dummy variable using strposHi everyone! I have searched this forum and read the official stata help section, but I'm still not…
advice on using duplicates drop commandHello, I would like to make use of "duplicates drop" command to drop out certain rows, For example,…
Specifying a GARCH(1,1) modelHi, I am trying to find the conditional variance for multiple countries' HP filter ln of GDP using t…
Xtreg vs REGFEHD, time varied weightsI am running a panel regression with the returns of various mutual funds as a function of time varie…
forvalues with indefinite end valueI would like to use a do loop to read in a series of excel files, save them as .dta files, then appe…
Subscribe to:
Post Comments (Atom)
0 Response to Looping increasing cellranges and importing to stata
Post a Comment