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
How to code to calculate Buy-and-hold Abnormal Return (BHAR)We use the income from May of T+1 to April of T+2 as T annual income.BHAR is equal to the multiplier…
Help with time-dependent variable in longitudinal dataHi everyone, I am working on panel data as shown below: I want to generate a time-dependent covar…
How to browse data with complicated conditionI have firm-level data for 2010-2015. I would like to browse variable output and capital for specifi…
Random sampleHello to all, I try to learn stata by myself as a economist, So I want to make a boucle to make a r…
spmap location of geographic labelsHi, I am using a shapefile for the UK regions (NUTS1) from https://data.gov.uk/dataset/2aa6727d...u…
Subscribe to:
Post Comments (Atom)
0 Response to Import Excel Loop issues
Post a Comment