Option
Explicit
Sub
TesteSchleife()
Dim
Zelle
As
Range
Dim
x
As
Integer
Dim
Suche
As
Variant
For
x = 1
To
10
Suche =
"Test"
&
CStr
(x)
If
Columns(
"A"
).Find(Suche, , xlValues, xlWhole)
Is
Nothing
Then
If
MsgBox(Suche &
" nicht in Spalte"
& Chr(10) & _
"weitersuchen (Ja / Nein)"
, vbYesNo) = _
vbNo
Then
Exit
Sub
End
If
Next
x
End
Sub
Sub
TesteVorgabe()
Dim
Zelle
As
Range
Dim
Vorgabe()
As
Variant
Dim
Suche
As
Variant
Vorgabe = Array(
"Maus"
,
"Elefant"
)
For
Each
Suche
In
Vorgabe
If
Columns(
"A"
).Find(Suche, , xlValues, xlWhole)
Is
Nothing
Then
If
MsgBox(Suche &
" nicht in Spalte"
& Chr(10) & _
"weitersuchen (Ja / Nein)"
, vbYesNo) = _
vbNo
Then
Exit
Sub
End
If
Next
Suche
End
Sub