Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Extract Data From Multiple Excel Files - One File

I need a way to extract data from multiple excel files (31) and put the data
into one sheet. All the data I need is in the same spots (B6:F29). I am
familiar with macros but not programming. Is there a simple way to do this?

Thank You

--
Message posted via http://www.officekb.com
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default Extract Data From Multiple Excel Files - One File

Look here Michael
http://www.rondebruin.nl/copy3.htm


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


"Michael via OfficeKB.com" wrote in message ...
I need a way to extract data from multiple excel files (31) and put the data
into one sheet. All the data I need is in the same spots (B6:F29). I am
familiar with macros but not programming. Is there a simple way to do this?

Thank You

--
Message posted via http://www.officekb.com



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Extract Data From Multiple Excel Files - One File


Where are the source files located? If they are all in the same
directory then you can loop through all the workbooks in that directory
and copy from the desired sheets the range specified and paste into the
new workbook.


Code:
--------------------
Sub ConsolidateData()
Dim FileSystem As Object, myFolder As Object
Dim myFiles As Object, myFile As Object
Dim wkb, Col As Integer, result
Set FileSystem = CreateObject("Scripting.FileSystemObject")
Set myFolder = FileSystem.getfolder(CurDir)
Set myFiles = myFolder.Files
For Each myFile In myFiles
Col = ThisWorkbook.Sheets(1).UsedRange.Columns.Count
Workbooks.Open (myFile)
ActiveWorkbook.Sheets(1).Range("B6:F29").Copy
ActiveSheet.Paste Destination:=ThisWorkbook.Sheets(1).Cells(1, Col) '= ActiveWorkbook.Sheets(1).Range("B6:F29")
Workbooks.Open(myFile).Close False
Next myFile

End Sub
--------------------


Give this a try and see if it gives you the results you are after.
This will use the Current Directory as the source for the files to pull
data from, and pulls data from the first sheet of each file found in the
current directory and pastes it in the next avaliable colulmn in the
workbook from which you are running the code.

If you need help with further modifications post back.


--
bhofsetz
------------------------------------------------------------------------
bhofsetz's Profile: http://www.excelforum.com/member.php...o&userid=18807
View this thread: http://www.excelforum.com/showthread...hreadid=380185

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Extract Data From Multiple Excel Files - One File

Thank you, I will give that a try!

--
Message posted via http://www.officekb.com
Reply
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
Gather data from multiple excel files into one master excel file Mark Allen Excel Discussion (Misc queries) 18 September 9th 08 01:06 PM
Extract cell data from multiple files in one folder smonsmo Excel Discussion (Misc queries) 3 August 17th 07 11:16 PM
Macro: Filter Multiple header then extract to Multiple Files [email protected] Excel Discussion (Misc queries) 9 December 8th 06 10:44 PM
Extract Data from Multiple Excel Files Steven Excel Discussion (Misc queries) 1 November 2nd 06 04:58 PM
extract key words/data from multiple files -dump in new worksheet MikeR-Oz New Users to Excel 10 March 20th 06 08:14 AM


All times are GMT +1. The time now is 09:43 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"