Suchfunktion in Excel
04.11.2018 16:08:50
Marquardt
vielleicht kann mir jemand helfen.
Zu der Suchfunktion brauche ich noch Zeile und Spalte als erste in der Auswertung.
Private Sub CommandButton1_Click()
Dim lng As Long
Dim wks1 As Worksheet
Dim i
Dim SN
Dim Suche
SN = Application.InputBox("Kunden eingeben")
Set wks1 = Worksheets("Abnahme")
lng = ThisWorkbook.Sheets("Abnahme").Cells(Rows.Count, 1).End(xlUp).Row
For i = 2 To lng
If InStr(wks1.Cells(i, 1).Value, SN) Then
Suche = Suche & wks1.Cells(i, 1).Value & " " & wks1.Cells(i, 2).Value & Chr(13)
End If
Next
MsgBox Suche
End Sub
Ist das überhaupt noch möglich?Danke.