ich benutze folgenden Code zum Suchen von Werten und Übertrag in Textboxen:
Private Sub CommandButton6_Click()
'Dim i%, found As String 'Boolean 'mit Boolean kann nur text in kleinschreibung gesucht _
werden mit String Zahlen und Text gross und kleinschreibung
Dim i%, found As String 'Boolean 'mit Boolean kann nur text in kleinschreibung gesucht _
werden mit String Zahlen und Text gross und kleinschreibung
found = False
For i = 1 To Anz
If TextBox1.Value = Data(i, 1) Then
If TextBox2.Value = Data(i, 2) Then
If TextBox3.Value = Data(i, 3) Then
Zeile = i + 1
TextBox9.Value = "Gefunden in Zeile " & Zeile
TextBox4.Value = Data(i, 1)
TextBox5.Value = Data(i, 2)
TextBox6.Value = Data(i, 3)
TextBox7.Value = Data(i, 4)
TextBox8.Value = Data(i, 5)
TextBox10.Value = Data(i, 6)
TextBox11.Value = Data(i, 7)
TextBox12.Value = Data(i, 8)
' TextBox13.Value = Data(i, 9)
' TextBox14.Value = Data(i, 10)
found = True
Exit For
End If
End If
End If
Next i
If found Then
TextBox4.Enabled = True
TextBox5.Enabled = True
TextBox6.Enabled = True
TextBox7.Enabled = True
TextBox8.Enabled = True
TextBox10.Enabled = True
TextBox11.Enabled = True
TextBox12.Enabled = True
' TextBox13.Enabled = True
' TextBox14.Enabled = True
Range(Cells(Zeile, 1), Cells(Zeile, 8)).Select
Else
TextBox9.Value = "Suchkriterien-Kombination nicht gefunden"
End If
End Sub
Das Problem ist, dass der Code für TextBox1 ein Datum finden soll. Dies erfolgt jedoch nicht mit Boolean und String. Was muss bitte geändert werden, damit er das Datum findet.
Danke für Eure Hilfe.
Gruss Peter