I would like to extract data from an excel spreadsheet regularly, e.g. cell (B46:F49), then cell(B86:F89), and so on (every 40 rows).
I tried the following code however I must have made certain mistake, and your help is greatly appreciated.
Thank you.
Code:
foreach x of numlist 1/10 { import excel "Summary_Report.xls", sheet("ReportSummary") cellrange(B'(46+(`x'-1)*40)':F'(49+(`x'-1)*40)') save cell_batch_`x'.dta clear }
0 Response to extract data from excel in loop
Post a Comment