Hello, I was looking for various solutions on the Internet, but I didn't find anything that could help me. So here's the code:
Private Sub TextBox1_Change()
Dim foundRng As Range
Set haslo = TextBox1
Set foundRng = Range("D3:D19").Find(haslo)
If foundRng Is Nothing Then
Exit Sub
Else
Application.Goto Reference:=foundRng
End If
End Sub
it's a mini search engine, or that's how it's supposed to work. In the current form, the entered value is searched for, but the problem appears, when there are more such values because the search stops at the first value found - is it possible to code this field so that after pressing the enter key, it goes to the next cell with the entered text? I have been working with VBA for 3 weeks and it is beyond my abilities
Private Sub TextBox1_Change()
Dim foundRng As Range
Set haslo = TextBox1
Set foundRng = Range("D3:D19").Find(haslo)
If foundRng Is Nothing Then
Exit Sub
Else
Application.Goto Reference:=foundRng
End If
End Sub
it's a mini search engine, or that's how it's supposed to work. In the current form, the entered value is searched for, but the problem appears, when there are more such values because the search stops at the first value found - is it possible to code this field so that after pressing the enter key, it goes to the next cell with the entered text? I have been working with VBA for 3 weeks and it is beyond my abilities