Macros pull from all files in a folder

tomwac

New Member
Joined
Mar 4, 2011
Messages
3
I can run a pull for files I've names in a folder using the following Macros:

' ELC
' Open the ELC Audit Workbook and Copy into buffer
Workbooks.Open Filename:=ActiveWorkbook.Path & "\2011 - RCM - ELC Tests Plant.xls"
Sheets("Testing Summary").Select
Cells.Select
Selection.Copy
' Paste Testing Summary updates into Master
Windows("2011 Obslog Consolidator.xls").Activate
Sheets("ELC Summary").Select
Cells.Select
ActiveSheet.Paste
' Remove formulas from all rows
Cells.Select
Selection.Copy
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Application.CutCopyMode = False
Range("A1").Select
' Go back and close the Closing Workbook
Windows("2011 - RCM - ELC Tests Plant.xls").Activate
Application.CutCopyMode = False
ActiveWorkbook.Close SaveChanges:=False
' Go back to Master Sheet Summary Tab
Windows("2011 Obslog Consolidator.xls").Activate
Sheets("Observation Log").Select
Range("A1").Select

But what I would like to do is pull all files in a given folder without having to specify the file name. (i.e. the Macros will pull results from all files in a folder, not discriminating by file name.)

I apprecaite any help and suggestions anyone has. Thanks.
-Tom
 

Excel Facts

Save Often
If you start asking yourself if now is a good time to save your Excel workbook, the answer is Yes

Forum statistics

Threads
1,214,978
Messages
6,122,547
Members
449,089
Latest member
davidcom

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top