Private Sub UserForm_Initialize()
Set f = Sheets("tableau")
Set mondico = CreateObject("Scripting.Dictionary")
For Each c In f.Range("a2:a" & f.[a65000].End(xlUp).Row)
mondico(c.Value) = c.Value
Next c
Me.ListBox1.List = mondico.items
End Sub
Private Sub CommandButton1_Click()
i = ListBox1.Value + 1
NUM = InputBox( _
Prompt:="N° associé :", _
Default:="")
With Worksheets("tableau")
.Range("AS" & i) = "Accepté"
.Range("AT" & i) = NUM
End With
Me.ListBox1.BackColor = RGB(0, 255, 0)
End Sub
Private Sub CommandButton2_Click()
i = ListBox1.Value + 1
With Worksheets("tableau")
.Range("AS" & i) = "Refusé"
End With
Me.ListBox1.BackColor = RGB(255, 0, 0)
Me.Repaint
End Sub
Private Sub CommandButton3_Click()
Unload UserForm1
End Sub