Private
Sub
Suchen_Click()
Dim
rngCell
As
Range
Dim
strFirstAddress
As
String
With
Worksheets(
"Inserate"
).Range(
"A:F"
)
Me
.ListBox1.Clear
Set
rngCell = .Find(
Me
.ComboBox1.Value, LookIn:=xlValues, lookat:=xlWhole)
strFirstAddress =
""
If
Not
rngCell
Is
Nothing
Then
strFirstAddress = rngCell.Address
Do
If
ComboBox2.Value = rngCell.Offset(0, -3)
Then
With
Me
.ListBox1
.ColumnCount = 6
.AddItem
.List(.ListCount - 1, 0) = rngCell.Offset(0, -5).Value
.List(.ListCount - 1, 1) = rngCell.Offset(0, -4).Value
.List(.ListCount - 1, 2) = rngCell.Offset(0, -3).Value
.List(.ListCount - 1, 3) = rngCell.Offset(0, -2).Value
.List(.ListCount - 1, 4) = rngCell.Offset(0, 0).Value
.ColumnWidths =
"2,5cm;1,5cm;2,5cm;2,5cm"
End
With
End
If
Set
rngCell = .FindNext(rngCell)
Loop
While
Not
rngCell
Is
Nothing
And
rngCell.Address <> strFirstAddress
Else
MsgBox
"es konnte kein Eintrag gefunden werden"
End
If
End
With
End
Sub