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
Extracting a month/year variable from a dateI'm new to Stata and I have a dumb question. I have a date variable (indexdate) with the format %tdD…
How to keep whole group with a variable including 3 valuesHi I have a panel data with firm and year. I want to keep only firms that headquartered in US and at…
semi-parametric quantile modelHi, How to run semi-parametric quantile regression in Stata? There is a way to run semi-parametric …
issue with "svy: biprobit"Hi everyone, I have a longitudinal panel data with the person-spell format where a spell is defined …
Append all .dta files in directoryMany people asked this quesion on 'batch appending' in many ways. Some of them are obscure so I trie…
Subscribe to:
Post Comments (Atom)
0 Response to Import Excel Loop issues
Post a Comment