Ich brauche hilfe für die einbindung einer Textnachricht wen der wert nicht mit der eigabe in der "Suchen.value" übereinstimmt, sonst gibt mir excel eine Fehlermeldung.
Hier der Code:
Private Sub SuchenArtNr_Click()
'Datum schreiben in die datumzelle der Bestellung
TextBoxcomandato.Value = Format(Date, "DD.MM.YYYY")
' ArtikelNr Suchen
Dim wonr As String
wonr = [Suchen].Value
Sheets("Lager").Select
Range("A3").Select
Selection.AutoFilter
Selection.AutoFilter
ActiveWindow.ScrollColumn = 1
Selection.AutoFilter Field:=2, Criteria1:=wonr
Range("A4:" & Range("A4").End(xlDown).Address).SpecialCells(xlCellTypeVisible).Select
' Makro für holen der daten in die Textboxen von Tabelle "Lager"
Range("a4:" & Range("a4").End(xlDown).Address).SpecialCells(xlCellTypeVisible).Select
Me.TextBoxCategoria = Selection.Value
Range("b4:" & Range("b4").End(xlDown).Address).SpecialCells(xlCellTypeVisible).Select
Me.TextBoxArtNr = Selection.Value
Range("c4:" & Range("c4").End(xlDown).Address).SpecialCells(xlCellTypeVisible).Select
Me.TextBoxArtName = Selection.Value
Range("e4:" & Range("e4").End(xlDown).Address).SpecialCells(xlCellTypeVisible).Select
Me.TextBoxSoll = Selection.Value
Range("f4:" & Range("f4").End(xlDown).Address).SpecialCells(xlCellTypeVisible).Select
Me.TextBoxAktuell = Selection.Value
Range("g4:" & Range("g4").End(xlDown).Address).SpecialCells(xlCellTypeVisible).Select
Me.TextBoxBestellt = Selection.Value
Range("a4:" & Range("a4").End(xlDown).Address).SpecialCells(xlCellTypeVisible).Select
Selection.AutoFilter
End Sub