1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
| Sub Macro4()
Dim x As String
' Extraction du lien (peut mieux faire ;-)
x = ThisWorkbook.Worksheets("feuil1").Range("A1").Formula
x = Replace(Mid(x, 1, InStr(1, x, ",") - 1), "=HYPERLINK(", "")
x = Mid(x, 2, Len(x) - 2)
' Ajout du lien
Dim Macell As Range
Set Macell = ThisWorkbook.Worksheets("feuil1").Range("B1")
On Error Resume Next
Macell.Hyperlinks(1).Delete
On Error GoTo 0
Macell.Hyperlinks.Add Anchor:=Macell, Address:=x _
, SubAddress:="0", TextToDisplay:=x
' Suivre le lien
Macell.Hyperlinks(1).Follow
End Sub |
Partager