Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() 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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Gather data from multiple excel files into one master excel file | Excel Discussion (Misc queries) | |||
Extract cell data from multiple files in one folder | Excel Discussion (Misc queries) | |||
Macro: Filter Multiple header then extract to Multiple Files | Excel Discussion (Misc queries) | |||
Extract Data from Multiple Excel Files | Excel Discussion (Misc queries) | |||
extract key words/data from multiple files -dump in new worksheet | New Users to Excel |