Option
Explicit
Public
Sub
Suchen_kopieren()
Dim
strSuche
As
String
, raFund
As
Range, loLetzte
As
Long
strSuche = Worksheets(
"Overview"
).Range(
"B2"
)
If
Not
strSuche = vbNullString
Then
With
Worksheets(
"Daten"
)
Set
raFund = .Rows(1).Find(what:=strSuche, LookIn:=xlValues, lookat:=xlWhole)
If
Not
raFund
Is
Nothing
Then
Worksheets(
"Overview"
).Range(
"B5:D15"
).ClearContents
loLetzte = .Cells(.Rows.Count, raFund.Column).
End
(xlUp).Row
.Range(.Cells(2, raFund.Column), .Cells(loLetzte, raFund.Column)).Copy
Worksheets(
"Overview"
).Range(
"B5"
).PasteSpecial Paste:=xlPasteValues
Application.CutCopyMode =
False
Else
MsgBox
"Suchbegriff "
& strSuche &
" nicht vorhanden."
End
If
End
With
End
If
End
Sub