Private
Sub
CB_Start_Click()
Dim
rngFind
As
Range
Dim
strSuchbegriff
As
String
Dim
strErsteZelle
As
String
Dim
strSuchbegriffFound
As
String
Dim
strSuchbegriffNotFound
As
String
Dim
zeile
As
Long
Dim
x
As
Long
Application.ScreenUpdating =
False
With
Sheets(
"ABC"
)
If
.FilterMode
Then
.ShowAllData
End
If
.Range(
"E2:H1000000"
).Interior.ColorIndex = 2
End
With
With
UF_Suche
If
.ListBoxUF2.ListCount = 0
Then
MsgBox (
"Bitte treffen Sie eine Auswahl!"
)
Exit
Sub
End
If
For
zeile = 0
To
.ListBoxUF2.ListCount - 1
strSuchbegriff = .ListBoxUF2.List(zeile)
If
Not
strSuchbegriff =
""
Then
With
Sheets(
"ABC"
).Range(
"E2:H1000000"
)
Set
rngFind = .Find( strSuchbegriff , , , xlPart)
If
Not
rngFind
Is
Nothing
Then
strErsteZelle = rngFind.Address
Do
rngFind.Interior.ColorIndex = 36
Set
rngFind = .FindNext(rngFind)
Loop
Until
rngFind
Is
Nothing
Or
rngFind.Address = strErsteZelle
strSuchbegriffFound = strSuchbegriffFound & Chr(10) &
"- "
& strSuchbegriff
Else
strSuchbegriffNotFound = strSuchbegriffNotFound & Chr(10) &
"- "
& strSuchbegriff
End
If
End
With
End
If
Next
zeile
End
With
Unload UF_Suche
.............Kommen noch paar MsgBox
Application.ScreenUpdating =
True
End
Sub