save a workbook with these codes inside the folder of your choice and run the macro. Copy the macro xxxx which you wish to run on all the files.
It lists all file names with IED p&l in it in col A. Opens each of them, runs the macro xxxx, saves the file and closes it. I suggest you try it on a test file before you use it.Code:Sub Jack() Dim z As Long, e As Long Dim f As String, b As String Application.ScreenUpdating = fasle Cells(1, 1) = "=cell(""filename"")" Cells(1, 2) = "=left(A1,find(""["",A1)-1)" Cells(2, 1).Select f = Dir(Cells(1, 2) & "*.xls") Do While Len(f) > 0 If InStr(f, "IED p&l") > 0 Then ActiveCell.Formula = f ActiveCell.Offset(1, 0).Select End If f = Dir() Loop z = Cells(Rows.Count, 1).End(xlUp).Row For e = 2 To z If Cells(e, 1) <> ActiveWorkbook.Name Then b = Cells(1, 2) & Cells(e, 1) Workbooks.Open Filename:=b Call xxxx ' xxxx is your macro name ActiveWorkbook.Close True End If Next e Application.ScreenUpdating = True MsgBox "complete." End Sub