This macro should be installed into your Consolidation workbook in a standard code module.
When you run it, it will first detect/create an Export sheet with today's date, then let you select as many files as you want, one at a time, and import them.
Just edit the default path so the file selector opens in the best "starting folder" for your searches.
Option Explicit
Sub ImportTodaysChoices()
'requires reference to Microsoft Office 11.0 Object Library
Dim wsNEW As Worksheet, wbDATA As Workbook, fNAME As String
Application.ScreenUpdating = False
With ThisWorkbook
fNAME = "Export_" & Format(Date, "MMDD")
If Not Evaluate("ISREF(" & fNAME & "!A1)") Then
.Sheets.Add(After:=.Sheets(.Sheets.Count)).Name = fNAME
.Sheets(fNAME).Range("A1:H1").Value = [{"ID","Name","Billable","Total Billed","Area","Pending","Begin","End"}]
End If
Set wsNEW = .Sheets(fNAME)
End With
Do
With Application.FileDialog(msoFileDialogOpen)
.InitialFileName = "C:\2012\Test\" 'default path to open to
.AllowMultiSelect = False
.Filters.Add "Excel Files", "*.xl*", 1 'default
.Title = "Select a file to Import"
.Show
If .SelectedItems.Count > 0 Then
fNAME = .SelectedItems(1)
Else
Application.ScreenUpdating = True
Exit Sub
End If
End With
Set wbDATA = Workbooks.Open(fNAME)
ActiveSheet.UsedRange.Offset(1).Copy wsNEW.Range("A" & Rows.Count).End(xlUp).Offset(1)
wbDATA.Close False
wsNEW.Columns.AutoFit
Loop
End Sub
Bookmarks