Sub
Schaltfläche1_Klicken()
Dim
strSuche
As
String
, raFund
As
Range, loLetzte
As
Long
strSuche =
"Karotte"
With
Worksheets(
"Phantasie"
)
Set
raFund = .Columns(
"A"
).Find(what:=strSuche, LookIn:=xlValues, lookat:=xlWhole)
If
Not
raFund
Is
Nothing
Then
loLetzte = .Cells(.Rows.Count,
"A"
).
End
(xlUp).Row
.Range(
"A"
& raFund.Row &
":A"
& loLetzte).EntireRow.Copy _
Worksheets(
"Realität"
).Range(
"A1"
)
.Range(
"A"
& raFund.Row &
":A"
& loLetzte).EntireRow.Delete
Else
MsgBox
"Fehler: "
& strSuche &
" wurde nicht gefunden."
End
If
End
With
Set
raFund =
Nothing
End
Sub