Try :
Sub test()
Dim lk, mySheet As String, sh As Worksheet
Dim f As String, p As String, Addr As String
Dim oldTxt As String, newTxt As String, c As Range
Dim Pos As Integer, ResAdr As String
Application.ScreenUpdating = False
For Each lk In ActiveWorkbook.LinkSources(xlExcelLinks)
f = Dir(lk)
Workbooks.Open lk
mySheet = Sheets(1).Name
rep = InputBox("If needed, change the sheet name for workbook "
& f, , mySheet)
If rep <> "" Then mySheet = rep
p = ActiveWorkbook.Path
ActiveWorkbook.Close False
oldTxt = "='" & p & "\[" & f & "]"
For Each sh In Sheets
Set c = sh.Cells.Find(oldTxt, , xlFormulas)
If Not c Is Nothing Then
Do
ResAdr = c.Address
Pos = InStr(1, c.Formula, "!")
Adr = Right(c.Formula, Len(c.Formula) - Pos)
newTxt = "='" & p & "\[" & f & "]" & mySheet & "'!"
& Adr
c.Formula = newTxt
Set c = sh.Cells.FindNext(c)
Loop While c <> "" And c.Address <> ResAdr
End If
Next sh
Next lk
Application.ScreenUpdating = True
End Sub
HTH
Daniel
yes i have 7 external files, 6 of them have 6 sheets and the last one has 14.