rharri1972
Board Regular
- Joined
- Nov 12, 2021
- Messages
- 132
- Office Version
- 2019
- Platform
- Windows
Hello!
I have a userform with a listbox and a textbox with a command button.
I have been able to type the part number in the textbox and hit the "FIND" button and it would search through and highlight that part number in the list box.
Now for some reason it will search some but not all part numbers. The same part number i've been using for testing the sub's all of a sudden quit being found.
Here is the code:
I don't see where anything has been changed or accidentally added or deleted. Any help?
I have a userform with a listbox and a textbox with a command button.
I have been able to type the part number in the textbox and hit the "FIND" button and it would search through and highlight that part number in the list box.
Now for some reason it will search some but not all part numbers. The same part number i've been using for testing the sub's all of a sudden quit being found.
Here is the code:
VBA Code:
Private Sub CommandButton3_Click()
Dim R As Range
On Error Resume Next
Set R = Sheets("PARTS LIST").Columns("A").Find( _
TextBox1.Value, LookIn:=xlValues, lookat:=xlWhole)
If R Is Nothing Then
MsgBox "Not found"
Else
R.Parent.Select
'Select the cell itself
R.Select
End If
Me.ListBox1.Value = R
End Sub
I don't see where anything has been changed or accidentally added or deleted. Any help?