PC Review


Reply
Thread Tools Rate Thread

copy data to one file from all files

 
 
TFMR
Guest
Posts: n/a
 
      17th Sep 2008
Hi All,

I have 50 excel files in folder I want to copy e1,f1,g1,h1,i1 to one new
file against file name. In new excel file in a column files name until 50 and
e1 the first file's data, e2 to i2 2nd files data and so on till 50 files.

Thanks
 
Reply With Quote
 
 
 
 
Joel
Guest
Posts: n/a
 
      17th Sep 2008
The code below will open ALL files in the directory FOLDER. Then copy the
data on Sheet1 E1:I1 to the next row in the workbook where the macro is run.
Change FOLDER and sheet Names as required.


Sub GetData()

Folder = "C:\temp\"

Set NewSht = ThisWorkbook.ActiveSheet
RowCount = 1

FName = Dir(Folder & "*.xls")
Do While FName <> ""
Set bk = Workbooks.Open(Filename:=Folder & FName)
bk.Sheets("Sheet1").Range("E1:I1").Copy _
Destination:=NewSht.Range("E" & RowCount)
bk.Close savechanges:=False
RowCount = RowCount + 1
FName = Dir()
Loop
End Sub

"TFMR" wrote:

> Hi All,
>
> I have 50 excel files in folder I want to copy e1,f1,g1,h1,i1 to one new
> file against file name. In new excel file in a column files name until 50 and
> e1 the first file's data, e2 to i2 2nd files data and so on till 50 files.
>
> Thanks

 
Reply With Quote
 
Ron de Bruin
Guest
Posts: n/a
 
      17th Sep 2008
See also
http://www.rondebruin.nl/summary2.htm

Or
http://www.rondebruin.nl/merge.htm

--

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm


"TFMR" <(E-Mail Removed)> wrote in message news:96B23284-A0A5-401A-A5F6-(E-Mail Removed)...
> Hi All,
>
> I have 50 excel files in folder I want to copy e1,f1,g1,h1,i1 to one new
> file against file name. In new excel file in a column files name until 50 and
> e1 the first file's data, e2 to i2 2nd files data and so on till 50 files.
>
> Thanks

 
Reply With Quote
 
TFMR
Guest
Posts: n/a
 
      18th Sep 2008
Thanks Ron de Bruin,

that is working fine.

Can u please help me for following issue:-

As I mentioned before that I have around 50 files in folder and I want to
run excel macro on all files in folder and save them.

Kindly help me plz.

Thanks

"Ron de Bruin" wrote:

> See also
> http://www.rondebruin.nl/summary2.htm
>
> Or
> http://www.rondebruin.nl/merge.htm
>
> --
>
> Regards Ron de Bruin
> http://www.rondebruin.nl/tips.htm
>
>
> "TFMR" <(E-Mail Removed)> wrote in message news:96B23284-A0A5-401A-A5F6-(E-Mail Removed)...
> > Hi All,
> >
> > I have 50 excel files in folder I want to copy e1,f1,g1,h1,i1 to one new
> > file against file name. In new excel file in a column files name until 50 and
> > e1 the first file's data, e2 to i2 2nd files data and so on till 50 files.
> >
> > Thanks

>

 
Reply With Quote
 
Ron de Bruin
Guest
Posts: n/a
 
      18th Sep 2008
Use this example
http://www.rondebruin.nl/copy4.htm

--

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm


"TFMR" <(E-Mail Removed)> wrote in message news:3D08F6FF-7E9C-4283-AA6D-(E-Mail Removed)...
> Thanks Ron de Bruin,
>
> that is working fine.
>
> Can u please help me for following issue:-
>
> As I mentioned before that I have around 50 files in folder and I want to
> run excel macro on all files in folder and save them.
>
> Kindly help me plz.
>
> Thanks
>
> "Ron de Bruin" wrote:
>
>> See also
>> http://www.rondebruin.nl/summary2.htm
>>
>> Or
>> http://www.rondebruin.nl/merge.htm
>>
>> --
>>
>> Regards Ron de Bruin
>> http://www.rondebruin.nl/tips.htm
>>
>>
>> "TFMR" <(E-Mail Removed)> wrote in message news:96B23284-A0A5-401A-A5F6-(E-Mail Removed)...
>> > Hi All,
>> >
>> > I have 50 excel files in folder I want to copy e1,f1,g1,h1,i1 to one new
>> > file against file name. In new excel file in a column files name until 50 and
>> > e1 the first file's data, e2 to i2 2nd files data and so on till 50 files.
>> >
>> > Thanks

>>

 
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
Re: File copy tool which can skip bad files during copy? PerkyPat Windows XP General 0 11th Apr 2009 09:15 PM
I am looking for a file copy program that will simply copy files without stopping LarryB Windows XP 6 8th Mar 2007 08:24 PM
How do I pull data from multiple files and copy into one file =?Utf-8?B?SlQ=?= Microsoft Excel Programming 2 3rd May 2005 07:42 PM
using File.Copy to copy files to shared hosting site Steve Richter Microsoft ASP .NET 4 18th Apr 2005 04:06 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 08:07 AM.