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 26 27 28 29 30 31 32
| Private Sub CommandButton8_Click()
Dim j As Integer
Dim numero As Integer
For i = 0 To ListBox2.ListCount - 1
If ListBox2.Selected(i) = True Then
With Feuil2
.Rows(i + 2).Copy
End With
With Feuil4
.Rows(1).Insert Shift:=xlDown
End With
End If
Next i
For i = 0 To ListBox2.ListCount - 1 'décoche toutes les cases
'sélection de l'item
ListBox2.Selected(i) = False
Next i
With Feuil4
numero = 1
For j = 1 To [nombre_charges]
.Cells(j, 1) = numero
numero = numero + 1
Next
End With
ListBox3.List() = [nom].Value
MsgBox ("Ces charges ont bien été ajoutées au BILAN")
End Sub |
Partager