شكرا لكم و جزاكم الله خير وجدت الحل مساعدة تشات جي ي تي و هو قريب من الكود المققترح من قبلكم لكنه يقوم تغيير اللينكات في كل الملف مهما كان تنوع الصفحات و اللينكات أضع الكود للفائدة
Sub ReplacePathsInAllSheets()
Dim ws As Worksheet
Dim oldPath As String
Dim newPath As String
Dim cell As Range
' Define old and new paths
oldPath = "C:\Users\Admin\Desktop\Teachers New\"
newPath = "C:\Users\Admin\Desktop\New Folder\Teachers New\"
' Loop through each worksheet in the workbook
For Each ws In ThisWorkbook.Worksheets
' Loop through each cell in the used range of the worksheet
For Each cell In ws.UsedRange
' Check if the cell contains a formula
If cell.HasFormula Then
' Replace old path with new path in the formula (handle single and multiple links)
If InStr(cell.Formula, oldPath) > 0 Then
cell.Formula = Replace(cell.Formula, oldPath, newPath)
End If
End If
Next cell
Next ws
MsgBox "All link paths have been updated!"
End Sub
حيث تتم اضافة موديول ثم تشغيله
شكرا لكم