close

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;

arrow
arrow
    全站熱搜
    創作者介紹
    創作者 software 的頭像
    software

    software

    software 發表在 痞客邦 留言(0) 人氣()