Private
Sub
Search0_Click()
Dim
wb
As
Workbook
Dim
ws1
As
Worksheet
Dim
ws2
As
Worksheet
Dim
such
As
String
, LetzteZeile
As
Long
, i
As
Long
Set
wb = ActiveWorkbook
Set
ws1 = wb.Worksheets(
"Übersicht"
)
Set
ws2 = wb.Worksheets(
"Daten"
)
such = UserForm1.TextBox1.Value
With
ws2
LetzteZeile = .Cells(.Rows.Count, 2).
End
(xlUp).Row
For
i = 5
To
LetzteZeile
If
.Cells(i, 2) = such
Then
MsgBox
"Wert gefunden"
UserForm1.TextBox2 = .Cells(i, 1)
UserForm1.TextBox3 = .Cells(i, 2)
Exit
For
End
If
Next
i
End
With
End
Sub