Jeremy
A function will not do what you want. You will need VBA. Something
like the following. Note that the code to do the actual copying/pasting
goes in the code in place of the MsgBox. Substitute your actual path in
place of the "Temp" folder. Please post back if you need more. HTH Otto
Sub AllFolderFiles()
Dim wb As Workbook
Dim TheFile As String
Dim MyPath As String
MyPath = "C:\Temp"
ChDir MyPath
TheFile = Dir("*.xls")
Do While TheFile < ""
Set wb = Workbooks.Open(MyPath & "\" & TheFile)
MsgBox wb.FullName
wb.Close
TheFile = Dir
Loop
End Sub
"Jeremy R." wrote in message
...
Thanks in advance for any help you can give me.
I have a need for a function to copy "certain data" from each file in a
folder. This folder gets bigger every week with new workbooks. The
"certain
data is always in the same cells in each workbook because each file is
made
from a template I created. However, they are in non-adjacent cells in my
worksheet.
I tried using some code from Ron de Bruin (http://www.rondebruin.nl/fso)
but
it did not give me the results I was looking for. I was unable to figure
out
the pieces of the code I need because I do not understand it all. It had
to
be a range of data or all of the data. It also created a new worksheet,
I
just want the data to come into the worksheet in which I ran the code.
What I need to know :
The way to run a loop through all the folders in my path.
Open or get the data from each workbook.
Copy the twelve data points I need from each one.
Place the data in a row my worksheet.
Go to the next workbook in my folder.
Copy the same twelve data points.
Find the next empty row.
Place the data in that row.
So on and so forth until all data is captured.
Any suggestions or help?