Bonjour,
j'utilise une macro pour changer mes liens hypertexte, le souci que je rencontre c'est que ça me change toute ma mise en forme, est-il possible de remédier à ce problème ?
merci d'avance
Sub Modifier_lien()
Dim Doc As Workbook
Dim Cell As Range
Dim OldStr As String
Dim NewStr As String
Dim OldHp As String
Dim NewHp As String
OldStr = "G:\xxx"
NewStr = "C:\xxx"
Application.Calculation = xlManual
Set Doc = Application.ActiveWorkbook
For Each Cell In Selection
If Cell.Hyperlinks.Count > 0 Then
OldHp = Cell.Hyperlinks(1).Address
NewHp = Replace(OldHp, OldStr, NewStr)
Cell.Hyperlinks.Delete
Doc.ActiveSheet.Hyperlinks.Add Anchor:=Cell, Address:=NewHp
End If
Next Cell
Application.Calculation = xlAutomatic
End Sub