Dim T 'déclaration d'un tableau en global, accessible depuis toutes les sub
Private Sub CommandButton1_Click() 'bouton generate
If ComboBox1.ListIndex > -1 And ComboBox2.ListIndex > -1 Then 'si selection dans les 2 CB
'initialisation de la textbox de l'USF Base
base.TextBox5 = T(ComboBox2.ListIndex + 1, ComboBox1.ListIndex + 1)
'Sortie de l'Usf UserForm1
Unload Me
Else
MsgBox "selectionner les combo"
End If
End Sub
Private Sub UserForm_Initialize()
ComboBox1.RowSource = ""
ComboBox2.RowSource = ""
With Worksheets("Feuil1") 'à adapter
ComboBox1.List = .Range("A2:A5").Value
ComboBox2.Column = .Range("B6:E6").Value
End With
'création du tableau des valeurs
T = [{"P2","P1","P0","P0";"P2","P2","P1","P0";"P3","P2","P2","P1";"P3","P3","P2","P2"}]
End Sub