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
| Private Sub ListBox1_DblClick(ByVal Cancel As MSForms.ReturnBoolean)
Dim TV As Variant
Dim I As Integer
TV = Worksheets("Feuil11").Range("A1").CurrentRegion
If Me.ComboBox1.Value = "" And Me.ComboBox2.Value = "" And Me.ComboBox3.Value = "" And Me.ComboBox4.Value = "" Then LI = Me.ListBox1.ListIndex + 1
If Me.ComboBox2.Value = "" And Me.ComboBox3.Value = "" And Me.ComboBox4.Value = "" Then
For I = 2 To UBound(TV, 1)
If CStr(TV(I, 1)) = Me.ComboBox1.Value And CStr(TV(I, 2)) = Me.ListBox1.Column(1, Me.ListBox1.ListIndex) And CStr(TV(I, 3)) = Me.ListBox1.Column(2, Me.ListBox1.ListIndex) And CStr(TV(I, 4)) = Me.ListBox1.Column(3, Me.ListBox1.ListIndex) Then LI = I
Next I
End If
If Me.ComboBox3.Value = "" And Me.ComboBox4.Value = "" Then
For I = 2 To UBound(TV, 1)
If CStr(TV(I, 1)) = Me.ComboBox1.Value And CStr(TV(I, 2)) = Me.ComboBox2.Value And CStr(TV(I, 3)) = Me.ListBox1.Column(2, Me.ListBox1.ListIndex) And CStr(TV(I, 4)) = Me.ListBox1.Column(3, Me.ListBox1.ListIndex) Then LI = I
Next I
End If
If Me.ComboBox4.Value = "" Then
For I = 2 To UBound(TV, 1)
If CStr(TV(I, 1)) = Me.ComboBox1.Value And CStr(TV(I, 2)) = Me.ComboBox2.Value And CStr(TV(I, 3)) = Me.ComboBox3.Value And CStr(TV(I, 4)) = Me.ListBox1.Column(3, Me.ListBox1.ListIndex) Then LI = I
Next I
End If
MsgBox "Ligne : " & LI
With Worksheets("Feuil11")
.Activate
.Cells(LI, 1).Select
End With
End Sub |
Partager