1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
| Private Sub ListBox1_Click()
Dim test1 As String
Dim FoundRange As Range
Dim Derligne As Integer
Dim Plage As Range
test1 = ListBox1.Value
With Sheets("BD")
Derligne = .Range("A65536").End(xlUp).Row + 1
Set Plage = .Range("F2", "F" & Derligne)
Set FoundRange = .Range.Find(Application.WorksheetFunction.Max(Plage), what:=test1, LookIn:=xlFormulas, lookat:=xlWhole)
If FoundRange Is Nothing Then
TextBox1.Value = "Pas d'entrée"
TextBox2.Value = "Pas d'entrée"
Else
TextBox1.Value = FoundRange.Offset(0, 5).Value
TextBox2.Value = FoundRange.Offset(0, 4).Value
End If
End With
End Sub |
Partager