1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
| Sub Test()
MsgBox VerifHyperlink(Range("A1"))
End Sub
Function VerifHyperlink(Cellule As Range) As Boolean
Dim Cible As String
'Verifie si la cellule contient un lien hypertexte
If Cellule.Hyperlinks.Count = 0 Then
VerifHyperlink = False
Exit Function
End If
'Extrait l'adresse du lien
Cible = Cellule.Hyperlinks(1).Address
'Verifie si le fichier existe sur le PC.
'(Ne fonctionne pas pour les liens web).
If Dir(Cible) <> "" And Cible <> "" Then
VerifHyperlink = True
Else
VerifHyperlink = False
End If
End Function |