LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #11   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default Macro copying info/data in multiple excel files into one summary file.

Try this

Do While FNames < ""
Set mybook = Workbooks.Open(FNames)

basebook.Worksheets(1).Range("AB" & rnum).Value = mybook.Worksheets(1).Range("A1").Value
basebook.Worksheets(1).Range("F" & rnum).Value = mybook.Worksheets(1).Range("H1").Value
basebook.Worksheets(1).Range("AD" & rnum).Value = mybook.Worksheets(1).Range("V1").Value


mybook.Close False
rnum = rnum + 1
FNames = Dir()
Loop

--
Regards Ron de Bruin
http://www.rondebruin.nl


"Jskasango via OfficeKB.com" <u20293@uwe wrote in message news:5e4de9fa4620a@uwe...
Hi Ron,

You are right. It is doing it. I will paste below a sample of how I have
achieved it but I am sure there must be a more professional and smooth way of
doing it. Thanks a million. My objective today is to get into cell in the
source file and copy only part of the contents.

This is how I modified the Sub FSO_Example_1():-

Set sourceRange = mybook.Worksheets(1).Range("A1:A1")
Set sourceRange2 = mybook.Worksheets(1).Range("H1:H1")
Set sourceRange3 = mybook.Worksheets(1).Range("V1:V1")

SourceRcount = sourceRange.Rows.Count
Set destrange = basebook.Worksheets(1).Range("AB" & rnum)
Set destrange2 = basebook.Worksheets(1).Range("F" & rnum)
Set destrange3 = basebook.Worksheets(1).Range("AD" & rnum)

I have just noticed that although it works, I forgot to mention Sourcerange3
at the top of the code, but it still worked!
Am I on the correct path? By tomoroww I want to be able to avoid duplicates
but I dont know how to do it.

Please have a very pleasant day.




Ron de Bruin wrote:
Can you give a example what you want

which are not necessarily next to each other,

The last link I posted is doing that

I have found Sub FSO_Example_1() (copy from excel files in folders and sub-
folders) extremely useful! BUT, now my problem is how to pick contents or

[quoted text clipped - 15 lines]
label in each file) into one Excel file , each source file info going to one
row in the destination file.


--
I travel 3rd Class because there is no 4th Class- Gandhi.

Message posted via OfficeKB.com
http://www.officekb.com/Uwe/Forums.a...mming/200604/1



 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Copying Multiple files in one file Macro - Liz Liz New Users to Excel 2 March 13th 07 02:45 PM
How do I get cell data in multiple Excel files into one summary fi 78degreesinHI Excel Worksheet Functions 4 August 29th 06 02:05 AM
Opening Multiple files and Copying the info all to one other sheet MsLucy Excel Discussion (Misc queries) 2 January 6th 06 05:41 PM
Extract Data From Multiple Excel Files - One File Michael via OfficeKB.com Excel Programming 3 June 20th 05 08:24 PM
Batch file to start multiple excel files with auto_open() macro. Delay code needed [email protected] Excel Programming 9 May 29th 05 07:02 AM


All times are GMT +1. The time now is 01:28 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"