Bonjour,
Je propose un variante de la solution de Xmenpl, comme ça l'Userform n'est pas fermé
Function list()
Dim col As Byte
Dim lign As Long, drlig As Long
'ListBox1.Clear
With Worksheets("Personnel").Range("L:P")
drlig = Worksheets("Personnel").Range("A" & Worksheets("Personnel").Rows.Count).End(xlUp).Row
For lign = 1 To drlig
Tache.ListBox1.AddItem .Cells(lign, 1)
For col = 1 To 9
Tache.ListBox1.list(Tache.ListBox1.ListCount - 1, col) = .Cells(lign, col + 1)
Next col
Next lign
End With
End Function
Private Sub CommandButton2_Click()
numligne = ListBox1.ListIndex
Sheets("Personnel").Cells(numligne + 1, 1) = TextBox1.Text
Sheets("Personnel").Cells(numligne + 1, 2) = TextBox2.Text
Sheets("Personnel").Cells(numligne + 1, 3) = TextBox3.Text Sheets("Personnel").Cells(numligne + 1, 4) = TextBox4.Text
Sheets("Personnel").Cells(numligne + 1, 5) = TextBox5.Text
ListBox1.Clear
actualisation = list()
End Sub
La fonction permet d'afficher les éléments dans le list box (attention faut changer la plage)
De plus tu peux réutiliser
ListBox1.Clear
actualisation = list()
pour actualiser quand tu appuies sur ajouter
A+