Sub
Suchen_Click()
Dim
suche
As
String
Dim
rngFind
As
Range
Dim
z
As
Long
Dim
Zelle
As
Range
Dim
Blatt
As
Worksheet
suche = InputBox(
"Suchen nach"
, ,
"Suchbegriff eingeben"
)
z = 0
If
suche =
""
Then
Exit
Sub
For
Each
Blatt
In
ActiveWorkbook.Worksheets
For
Each
Zelle
In
Blatt.UsedRange
If
Zelle = suche
Then
z = z + 1
Zelle.Interior.ColorIndex = 43
Set
rngFind = ActiveWorkbook.Find(suchfenster, LookIn:=xlValues)
If
Not
rngFind
Is
Nothing
Then
strFirst = rngFind.Address
Do
rngFind.
Select
If
MsgBox(rngFind.Address, vbOKCancel) = vbOK
Then
Set
rngFind = ActiveWorkbook.FindNext(rngFind)
Else
Exit
Sub
End
If
Loop
While
Not
rngFind
Is
Nothing
And
rngFind.Address <> strFirst
End
If
MsgBox suche &
" wurde "
& z &
" mal gefunden."
End
If
End
Sub