Private Sub Worksheet_Activate()
Worksheet_Change ActiveCell 'lance la macro
End Sub
Private Sub Worksheet_Change(ByVal Target As Range)
Dim P As Range, r As Range, n&
Set P = [Tableau4] 'tableau structuré de la 1ère feuille
Set r = [Tableau3] 'tableau structuré de la 2ème feuille
Application.ScreenUpdating = False
Application.EnableEvents = False 'désactive les évènements
P.Columns(1).Clear 'RAZ
P.ListObject.Resize P.ListObject.Range.Resize(r.Rows.Count + 1) 'redimensionne le tableau
Set P = P(1)
For Each r In r.Columns(1).Cells
n = n + 1
P.Parent.Hyperlinks.Add P(n), "", "", ScreenTip:=r.Text, TextToDisplay:=Left(r, 1)
Next
'---mise en forme---
With P.Resize(n)
Union(P(0), .Cells).HorizontalAlignment = xlCenter 'centrage
.Font.ColorIndex = xlAutomatic
.Font.Underline = xlUnderlineStyleNone
End With
Application.EnableEvents = True 'téactive les évènements
End Sub