Sub
suchen()
ListBox1.Clear
With
Sheets(
"Bauteile"
)
zeilen =
","
Set
rng = .Range(
"A2:J"
& .Rows.Count).Find(What:=TextBox1.Value, LookIn:=xlValues, LookAt:=xlPart, MatchCase:=
False
, after:=.Cells(.Rows.Count, 1))
If
Not
rng
Is
Nothing
Then
strFirst = rng.Address
Do
If
InStr(zeilen,
","
& rng.Row &
","
) > 0
Then
ListBox1.AddItem rng.Value
ListBox1.List(lstSuche.ListCount - 1, 1) = rng.Offset(0, 1).Value
ListBox1.List(lstSuche.ListCount - 1, 2) = rng.Offset(0, 2).Value
ListBox1.List(lstSuche.ListCount - 1, 3) = rng.Row
zeilen = zeilen & rng.Row &
","
End
If
Set
rng = .Range(
"A2:J"
& .Rows.Count).FindNext(rng)
Loop
While
Not
rng
Is
Nothing
And
strFirst <> rng.Address
End
If
End
With
Set
rng =
Nothing
End
Sub