Bonjour à tous,
Je souhaiterai de l'aide s'il vous plaît sur quelques lignes de codes que je comprend à moitié, pouvez-vous m'apporter une explication plus claire pour maitriser ces actions :
Private Sub CommandButton6_Click()
Dim tableau_nom(10000, 1)
a = 0
For i = 0 To UserForm5.liste_nom.ListCount - 1
If UserForm5.liste_nom.Selected(i) = True Then
tableau_nom(a, 0) = UserForm5.liste_nom.List(i, 0)
tableau_nom(a, 1) = UserForm5.liste_nom.List(i, 1)
a = a + 1
End If
Next i
x = 8
For i = 0 To UBound(tableau_nom) - 1
If tableau_nom(i, 0) = "" Then Exit For
Do
If Sheets("CA").Cells(x, 3).Value = tableau_nom(i, 0) Then
Sheets("CA").Rows(x).Delete
x = x - 1
Exit Do
End If
x = x + 1
Loop Until Sheets("CA").Cells(x, 3).Value = ""
Next i
UserForm5.Hide
Unload Me
End Sub
Merci d'avance de votre aide.
Cordialement.
Jo
Je souhaiterai de l'aide s'il vous plaît sur quelques lignes de codes que je comprend à moitié, pouvez-vous m'apporter une explication plus claire pour maitriser ces actions :
Private Sub CommandButton6_Click()
Dim tableau_nom(10000, 1)
a = 0
For i = 0 To UserForm5.liste_nom.ListCount - 1
If UserForm5.liste_nom.Selected(i) = True Then
tableau_nom(a, 0) = UserForm5.liste_nom.List(i, 0)
tableau_nom(a, 1) = UserForm5.liste_nom.List(i, 1)
a = a + 1
End If
Next i
x = 8
For i = 0 To UBound(tableau_nom) - 1
If tableau_nom(i, 0) = "" Then Exit For
Do
If Sheets("CA").Cells(x, 3).Value = tableau_nom(i, 0) Then
Sheets("CA").Rows(x).Delete
x = x - 1
Exit Do
End If
x = x + 1
Loop Until Sheets("CA").Cells(x, 3).Value = ""
Next i
UserForm5.Hide
Unload Me
End Sub
Merci d'avance de votre aide.
Cordialement.
Jo