Hello everyone,
I'm trying to write code to import certain worksheets from an excel workbook, but I can't quite get it to work properly. Here's the code I have written for it so far:
cd "$pathin\Bank Spreadsheets\XLS spreadsheets"
foreach sheet in "Ex 1" "Ex 2" "Ex 3" "Ex 5" "Ex 6" "Ex 8" "Ex 9" "EX 10" "EX 11" "EX 12" {
import excel using "$pathin\Bank Spreadsheets\XLS spreadsheets\Caliber Home Loans-30992_FUP Findings Exhibits.xls", sheet("`sheet'") cellrange(A5) firstrow clear
save file_`sheet', replace
}
Unfortunately the syntax error that keeps popping up says "invalid '1'. I've tried checking the spacing and the naming of the sheets, but nothing seems to work. Any help would be great, thanks!
Related Posts with Import Excel Loop issues
Spatial Autoregressive Models with Categorical Outcome variable - is it possible?Hi, I have been working with SAR models and have recently come across a dataset where the outcome v…
FE, RE unbalanced panel Hausman testI have an unbalanced panel data (firms' financial and ownership data of 9 years) containing some key…
Taking the difference of observations of the same variableDear all, My problem is the following: I have a panel data of EU countries in which I have many kin…
mi impute chained: option savetrace() not allowed r(198)Hello, I ran the following commands to run a multiple imputation in Stata version 15.1, but ran int…
Importing multiple sheets from multiple excel files using loopHi everyone, I am importing 35 sheets from 35 excel files. The naming of excel sheets is such that …
Subscribe to:
Post Comments (Atom)
0 Response to Import Excel Loop issues
Post a Comment