Perdu dans l'adaptation d'un code vba
Bonjour,
je continu mes recherches de débutant... aujou'd'hui j'ai le code suivant qui fonctionne dans un userform, mais je souhaiterai l'adapter dans un autre userform sans combobox, en cliquant sur CommandButton1 simplement avec pour critère de selection : la valeur dans la colonne I est FAUX...
est-ce possible !?
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
| Private Sub ComboBox1_Click()
Dim Plage As Range, Est, Add As String, vLi As Integer, Vcol As Byte
With ListBox1
.Clear
.ColumnCount = 6
.ColumnWidths = "50;60;30;170;130;30"
Set Plage = Range("I2:I" & [I65000].End(xlUp).Row)
Set Est = Plage.Find(ComboBox1)
If Not Est Is Nothing Then
Add = Est.Address
Do
.AddItem Cells(Est.Row, 1)
For Vcol = 2 To 6
.List(vLi, Vcol - 1) = Cells(Est.Row, Vcol)
Next
vLi = vLi + 1
Set Est = Plage.FindNext(Est)
Loop While Not Est Is Nothing And Est.Address <> Add
End If
TextBox1 = .ListCount
End With
End Sub |