Rick Rothstein replied to BeSmart
01-Feb-10 12:28 AM
Give this code a try (it works on the active workbook only, but that can be
changed if needed)...
Sub ReplaceWorkbookName()
Dim OldFile As String, TargetFile As String, WS As Worksheet
OldFile = InputBox("Enter Old File Name")
TargetFile = InputBox("Enter New File Name")
On Error Resume Next
Application.DisplayAlerts = False
For Each WS In ThisWorkbook.Worksheets
WS.Cells.SpecialCells(xlCellTypeFormulas).Replace What:=OldFile, _
Replacement:=TargetFile, LookAt:=xlPart, MatchCase:=False
Next
Application.DisplayAlerts = True
End Sub
--
Rick (MVP - Excel)