Hope someone can help
What I want to do is have a macro that copies the same cells from 10
different specifically named excel files and pastes them onto the
relevant worksheet within another workbook. All the files will be
within 1 folder.
Hope this makes sence and someone can help.
Thanks--
kingdt
------------------------------------------------------------------------
kingdt's Profile: www.excelforum.com/member.php...oamp;userid=32531
View this thread: www.excelforum.com/showthread...hreadid=523143here is some pseudo code
Dim sname as String
Dim bk as Workbook
Dim rng as Range
sname = dir(quot;C:\Myfolder\Myfile*.xlsquot;)
do while sName lt;gt; quot;quot;
set bk = workbooks.open(quot;C:\MyFolder\quot; amp; sName)
set rng = bk.worksheets(1).Range(quot;A1:A10quot;)
rng.copy thisworkbook.worksheets( _
left(sName,len(sname)-4)).Range(quot;A1quot;)
bk.close Savechanges:=False
sName = dir()
Loop
Obviously I don't know how quot;particularquot; or quot;relevantquot; should be specifically
implemented in the code.--
Regards,
Tom Ogilvy
quot;kingdtquot; wrote:
gt;
gt; Hope someone can help
gt;
gt; What I want to do is have a macro that copies the same cells from 10
gt; different specifically named excel files and pastes them onto the
gt; relevant worksheet within another workbook. All the files will be
gt; within 1 folder.
gt;
gt; Hope this makes sence and someone can help.
gt;
gt; Thanks
gt;
gt;
gt; --
gt; kingdt
gt; ------------------------------------------------------------------------
gt; kingdt's Profile: www.excelforum.com/member.php...oamp;userid=32531
gt; View this thread: www.excelforum.com/showthread...hreadid=523143
gt;
gt;
- Mar 13 Thu 2008 20:42
Copy Data from Workbook into specific Worksheet in other Workbook?
close
全站熱搜
留言列表
發表留言