PC Review


Reply
Thread Tools Rate Thread

Copy Data from Workbook into specific Worksheet in other Workbook?

 
 
kingdt
Guest
Posts: n/a
 
      16th Mar 2006

Hope someone can help

What I want to do is have a macro that copies the same cells from 1
different specifically named excel files and pastes them onto th
relevant worksheet within another workbook. All the files will b
within 1 folder.

Hope this makes sence and someone can help.

Thank

--
kingd
-----------------------------------------------------------------------
kingdt's Profile: http://www.excelforum.com/member.php...fo&userid=3253
View this thread: http://www.excelforum.com/showthread.php?threadid=52314

 
Reply With Quote
 
 
 
 
=?Utf-8?B?VG9tIE9naWx2eQ==?=
Guest
Posts: n/a
 
      16th Mar 2006
here is some pseudo code
Dim sname as String
Dim bk as Workbook
Dim rng as Range
sname = dir("C:\Myfolder\Myfile*.xls")
do while sName <> ""
set bk = workbooks.open("C:\MyFolder\" & sName)
set rng = bk.worksheets(1).Range("A1:A10")
rng.copy thisworkbook.worksheets( _
left(sName,len(sname)-4)).Range("A1")
bk.close Savechanges:=False
sName = dir()
Loop

Obviously I don't know how "particular" or "relevant" should be specifically
implemented in the code.


--
Regards,
Tom Ogilvy

"kingdt" wrote:

>
> 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: http://www.excelforum.com/member.php...o&userid=32531
> View this thread: http://www.excelforum.com/showthread...hreadid=523143
>
>

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Macro to copy specific data from master workbook to another workbook Mark767 Microsoft Excel Programming 13 1st Sep 2009 08:57 PM
loop through a column on a workbook copying data on each row to another workbook, then copy data back to the original workbook burl_rfc Microsoft Excel Programming 1 1st Apr 2006 08:48 PM
quick copy worksheet into other sheets in same workbook =?Utf-8?B?TWljayBN?= Microsoft Excel New Users 2 20th Dec 2005 10:49 PM
Copy from different workbook's worksheet into a single worksheet... johnprasun@gmail.com Microsoft Excel Misc 1 27th Oct 2005 07:27 PM
Copy worksheet from Active workbook into all other open workbooks TroyB Microsoft Excel Programming 0 10th Feb 2004 11:29 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 11:13 PM.