Have a try with something like this:
Code:
Option Explicit
Sub general()
Dim z As Long, e As Long, a As Long, b As Range
Dim f As String, m As String, n As String
Sheets("Sheet1").Select
'Cells(1, 1) = "=cell(""filename"")" '<=not working
Cells(1, 1) = "filename" '<=changed
'Cells(1, 2) = "=left(A1,find(""["",A1)-1)" '<=didn't understand
Cells(1, 2) = "E:\Test\" '<=to be adjusted
Cells(2, 1).Select
f = Dir(Cells(1, 2) & "*.xls")
Do While Len(f) > 0
ActiveCell.Formula = f
ActiveCell.Offset(1, 0).Select
f = Dir()
Loop
m = InputBox("Enter search string")
n = InputBox("Enter replacement string") 'common replacement
z = Cells(Rows.Count, 1).End(xlUp).Row
Application.ScreenUpdating = False '<=added
'---test all workbooks found---
For e = 2 To z
If Cells(e, 1) <> ActiveWorkbook.Name Then
Workbooks.Open Filename:=Cells(1, 2) & Cells(e, 1)
'---test all sheets within book---
For a = 1 To Sheets.Count
With ActiveWorkbook.Sheets(a)
'---test all used cells within sheet---
For Each b In .UsedRange.Cells
If b.Value = m Then
b = n
End If
Next b
End With
Next a
ActiveWorkbook.Close True
End If
Next e
'---------------------------------------------------
Application.ScreenUpdating = True '<=added
MsgBox "collating is complete."
End Sub
Bookmarks