Private Sub Worksheet_Change(ByVal Target As Range)
Dim VCel As String, VDeb, VFin
If Target.Count > 1 Then Exit Sub
' Vérifie que l'on à mis un chiffre entre parenthèses
VCel = Target.Value
' Trouver la position de la parenthèse ouvrante
VDeb = InStr(1, VCel, "(", vbTextCompare)
' Trouver la positionde la parenthèse fermante
VFin = InStr(1, VCel, ")", vbTextCompare)
' Si les 2 flags sont à vrai
If VDeb >0 AND VFin >0 Then
With Target.Characters(Start:=VDeb, Length:=VFin - VDeb + 1).Font
.Name = "Arial"
.FontStyle = "Gras"
.Size = 10
.Strikethrough = False
.Superscript = True
.Subscript = False
.OutlineFont = False
.Shadow = False
.Underline = xlUnderlineStyleNone
.ColorIndex = 3
End With
Target.Select
' Insérer le lien hypertexte
Application.Dialogs(xlDialogInsertHyperlink).Show
End If
End Sub