Gday all,
I use Excel 2003 at work, and 2007 at home. The wife is crook today, so im working from home... well, trying to. I have searched the net for a solution to my particular prob, but while I am ok with developing and running some macro's, im not really a power user.
Problem:
I understand that Application.FileSearch has been depreciated in 2007, but I cannot seem to modify other suggested codes to make workarounds work with my needs. Im hoping someone here can help 
I have a folder with a many .xls files in it, all ending in "*metrics33yrs.xls", my 2003 code (sourced from the net) opens each one sequentially (1st part of below code), copies given cells, and pastes them into a separate workbook (2nd part of below code).
Can anyone please help with the first part of the code so that it works in 2007?
Cheers in advance
'---------------------------------------------------------------------------------------------------------
Sub RunAllFiles_AllMetrics()
Dim lCount As Long, wbResults As Workbook, wbCodeBook As Workbook
Application.ScreenUpdating = False
Application.DisplayAlerts = False
Application.EnableEvents = False
On Error Resume Next
Set wbCodeBook = ThisWorkbook
With Application.FileSearch
.NewSearch
'Change path to suit
.LookIn = "E:\Work\Work\MetricResults_010908"
.FileType = msoFileTypeExcelWorkbooks
.Filename = "*Metrics33*.xls"
If .Execute > 0 Then 'Workbooks in folder
For lCount = 1 To .FoundFiles.Count 'Loop through all.
'Open Workbook x and Set a Workbook variable to it
Set wbResults = Workbooks.Open(Filename:=.FoundFiles(lCount), UpdateLinks:=0)
'---------------------------------------------------------------------------------------------------------
thisname = ActiveWorkbook.Name
sitename = Split(thisname, "_")
shname = sitename(0) & "_Totems33yrs"
Sheets(shname).Activate
...selects and copies cells...
Windows("AllMetrics_EMLR+WMLR.xls").Activate
Select Case lCount
Case 0 To 10
asheet = "Sheet1"
Case 11 To 20
asheet = "Sheet2"
Case 21 To 30
asheet = "Sheet3"
Case 31 To 40
asheet = "Sheet4"
Case 41 To 50
asheet = "Sheet5"
Case 51 To 60
asheet = "Sheet6"
Case 61 To 70
asheet = "Sheet7"
Case 71 To 80
asheet = "Sheet8"
Case 81 To 90
asheet = "Sheet9"
Case 91 To 100
asheet = "Sheet10"
Case 101 To 110
asheet = "Sheet11"
Case 111 To 120
asheet = "Sheet12"
End Select
Sheets(asheet).Activate
Range("a1").Select
Selection.End(xlToRight).Select
ActiveCell.Offset(rowOffset:=0, columnOffset:=1).Activate
ActiveSheet.Paste
Bookmarks