Option Explicit
Private Dico As Dictionary
Function ValDico(ByVal Clé) As Variant
Dim TD(), TV(), L As Long, C As Long
If Dico Is Nothing Then
On Error Resume Next
TD = [PlageDico].Value
If Err Then MsgBox "Le nom ""PlageDico"" n'est pas défini", vbCritical, "ValDico": Exit Function
On Error GoTo 0
Set Dico = New Dictionary
If UBound(TD, 2) > 2 Then
ReDim TV(1 To 1, 1 To UBound(TD, 2) - 1)
For L = 1 To UBound(TD, 1)
For C = 1 To UBound(TD, 2) - 1: TV(1, C) = TD(L, C + 1): Next C
Dico(TD(L, 1)) = TV: Next L
Else
For L = 1 To UBound(TD, 1)
Dico(TD(L, 1)) = TD(L, 2): Next L
End If: End If
If Dico.Exists(Clé) Then ValDico = Dico(Clé)
End Function