Bookmark and Share

Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: st: Loop through to Import Multiple Excel Files


From   Nick Cox <[email protected]>
To   "[email protected]" <[email protected]>
Subject   Re: st: Loop through to Import Multiple Excel Files
Date   Wed, 3 Apr 2013 08:56:33 +0100

For "STATA" read "Stata". Please do read the FAQ before posting, as requested.

More importantly, the FAQ advises you to say _exactly_ what Stata
typed in response.

I suggest as code

local mylist  AB RB PC LS GO

foreach x of local mylist {

import excel C:\Users\Admin\Documents\Teaching\Marks_`x'.xlsx,
sheet("TI") firstrow clear

save `x', replace

}



© Copyright 1996–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index