LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default Taking data from multiple workbooks?

Hi Need Help Fast

I advise not to use FileSearch

1: have bugs
2: not working in Excel 2007

See this page for other solutions
http://www.rondebruin.nl/copy3.htm

But if it is working for your problem that it is OK


--

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


"Need Help Fast!" wrote in message
...
Thanks Joel! It worked

"Joel" wrote:

This should help. You need to fix source and destinattion files, but it
works really good

Sub GetData()

Set fs = Workbooks.Application.FileSearch
With fs
.LookIn = "c:\Temp"
.FileType = msoFileTypeExcelWorkbooks
.Execute
End With

For i = 1 To fs.FoundFiles.Count

MyfileName = fs.FoundFiles(i)
Workbooks.Open Filename:=MyfileName, ReadOnly:=True

' Removed pathname from file name so it can be referenced in this
program.
'Basic doesn't like the full pathname???? stupid microsoft
Do While (1)
CharPosition = InStr(MyfileName, "\")
If CharPosition 0 Then
MyfileName = Mid(MyfileName, CharPosition + 1)
Else
Exit Do
End If
Loop



Workbooks(MyfileName).Worksheets("Sheet1").Range(" B22:D24").Copy _

Destination:=Workbooks(ThisWorkbook.Name).Workshee ts("Sheet1"). _
Range("A10").Offset(rowOffset:=0, columnOffset:=0)

Workbooks(MyfileName).Close SaveChanges:=False

Next i


End Sub


"Need Help Fast!" wrote:

Hi,

I want to know how I can take data from multiple excel workbooks and have it
be put into one giant list in another excel workbook. The header is the same
for all of the data. It is different data for each state, so I have over 50.
Instead of copying and pasting each one into another workbook, I'd like to
automate it. Is there a way to write a macro that would take all of the excel
files in a folder and take from the exact same sheet in each excel file the
data and paste it onto one worksheet in another excel workbook? Thanks

-Need Help Fast!




 
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
extract data from multiple workbooks heather Excel Discussion (Misc queries) 1 December 20th 07 08:05 AM
taking data from multiple cells and displaying in one cell djarcadian Excel Discussion (Misc queries) 2 May 30th 06 09:31 PM
Data in multiple workbooks Krista Excel Worksheet Functions 1 May 8th 06 10:17 PM
Totaling data from multiple workbooks. hlflorek Excel Discussion (Misc queries) 1 April 23rd 06 08:17 AM
how do i summarize data in multiple workbooks? Norman Excel Programming 1 November 11th 05 09:20 PM


All times are GMT +1. The time now is 01:12 AM.

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"