VBA UserForm ListBox boucle
bobtipitt
-
bobtipitt Messages postés 61 Date d'inscription Statut Membre Dernière intervention -
bobtipitt Messages postés 61 Date d'inscription Statut Membre Dernière intervention -
Bonjour,
Comment on fais pour faire une boucle qui va changer de ligne dans un listbox.
Voici le code.
Private Sub CommandButton1_Click()
Unload UserForm6
Load UserForm7
UserForm7.Show
End Sub
Private Sub CommandButton2_Click()
Unload UserForm6
Range("B12").Select
Selection.ClearContents
End Sub
Private Sub CommandButton3_Click()
Unload UserForm6
End Sub
Private Sub CommandButton4_Click()
With Me.ListBox1
For I = 0 To .ListCount - 1
If .Selected(I) = True Then
y = y + 1
Range("G12:G35" & y).Value = .List(I)
End If
Next I
End With
End Sub
Private Sub ListBox1_Click()
End Sub
Private Sub TabStrip1_Change()
Load UserForm7
End Sub
Regarder a Commandebutton4
Comment on fais pour faire une boucle qui va changer de ligne dans un listbox.
Voici le code.
Private Sub CommandButton1_Click()
Unload UserForm6
Load UserForm7
UserForm7.Show
End Sub
Private Sub CommandButton2_Click()
Unload UserForm6
Range("B12").Select
Selection.ClearContents
End Sub
Private Sub CommandButton3_Click()
Unload UserForm6
End Sub
Private Sub CommandButton4_Click()
With Me.ListBox1
For I = 0 To .ListCount - 1
If .Selected(I) = True Then
y = y + 1
Range("G12:G35" & y).Value = .List(I)
End If
Next I
End With
End Sub
Private Sub ListBox1_Click()
End Sub
Private Sub TabStrip1_Change()
Load UserForm7
End Sub
Regarder a Commandebutton4
A voir également:
- VBA UserForm ListBox boucle
- Excel compter cellule couleur sans vba - Guide
- Vba attendre 1 seconde ✓ - Forum VB / VBA
- Xiaomi s'éteint tout seul et se rallume en boucle - Forum Xiaomi
- Vba ouvrir un fichier excel avec chemin ✓ - Forum VB / VBA
- Find vba - Astuces et Solutions
3 réponses
bonjour
Private Sub CommandButton4_Click()
dim l as integer
l=Me.ListBox1.ListCount - 1
For I = 0 To l
If Me.ListBox1.Selected(I) = True Then
y = y + 1
Range("G12:G35" & y).Value = Me.ListBox1.List(I)
End If
Next I
End Sub
Private Sub CommandButton4_Click()
dim l as integer
l=Me.ListBox1.ListCount - 1
For I = 0 To l
If Me.ListBox1.Selected(I) = True Then
y = y + 1
Range("G12:G35" & y).Value = Me.ListBox1.List(I)
End If
Next I
End Sub