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
 

Forum statistics

Threads
1,081,543
Messages
5,359,429
Members
400,526
Latest member
Brook1083

Some videos you may like

This Week's Hot Topics

  • VBA (Userform)
    Hi All, I just would like to know why my code isn't working. Here is my VBA code: [CODE=vba]Private Sub OKButton_Click() Dim i As Integer...
  • List box that changes fill color
    Hello, I have gone through so many pages trying to figure this out. I have a 2020 calendar that depending on the day needs to have a certain...
  • Remove duplicates and retain one. Cross-linked cases
    Hi all I ran out of google keywords to use and still couldn't find a reference how to achieve the results of a single count. It would be great if...
  • VBA Copy and Paste With Duplicates
    Hello All, I'm in need of some input. My VBA skills are sub-par at best. I've assembled this code from basic research and it works but is...
  • Macro
    is it possible for a macro to run if the active cell value is different to the value above it
  • IF DATE and TIME
    I currently use this to check if date has passed but i also need to set a time on it too. Is it possible? [CODE=vba]=IF(B:B>TODAY(),"Not...
Top