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
| '
' Fonction ComboBox1_Change.. pour debug à detruire ensuite
' Affiche le mot de passe
Private Sub ComboBox1_Change()
MsgBox Range("B1").Offset(ComboBox1.ListIndex, 0)
End Sub
Private Sub CommandButton1_Click()
If ComboBox1.ListIndex >= 0 Then
If Range("B1").Offset(ComboBox1.ListIndex, 0) = TextBox1 Then
MsgBox ("Mot de passe OK")
Else
MsgBox ("Errur mot de passe")
End If
End If
End Sub
Private Sub UserForm_Initialize()
Dim r As Range
Set r = Range("A1").CurrentRegion
ComboBox1.Clear
For i = 1 To r.Rows.Count
ComboBox1.AddItem r.Cells(i, 1)
Next
End Sub |
Partager