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
| Private Sub CommandButton1_Click()
Dim i, j As Integer
Dim str As String
UserForm4.Hide
With Worksheets("Retenues")
For i = 0 To .Columns(1).Find("*", , , , xlByColumns, xlPrevious).Row
str = ""
If .Range("A1").Offset(i, 0).Value = ComboBox1 And .Range("B1").Offset(i, 0).Value = ComboBox2 And .Range("C1").Offset(i, 0).Value = ComboBox3 Then
For j = 0 To .Rows(.Range("A1").Offset(i, 0).Row).Find("*", , , , xlByColumns, xlPrevious).Column
str = str & .Range("A1").Offset(i, j).Value & " "
Next j
With UserForm8.ListBox1
.Clear
.ColumnCount = 6
.ColumnWidths = "50;60;30;170;130;30"
End With
UserForm8.ListBox1.AddItem (str)
End If
Next i
End With
UserForm8.Show
End Sub |
Partager