ipbr21054
Well-known Member
- Joined
- Nov 16, 2010
- Messages
- 5,832
- Office Version
- 2007
- Platform
- Windows
I am using the code below
On my userform i type in Textbox1 a value.
The code then looks for that value on my worksheet.
IAs each value is found i would like to have the row number put into listbox1
Please advise how we can this this.
Thanks
On my userform i type in Textbox1 a value.
The code then looks for that value on my worksheet.
IAs each value is found i would like to have the row number put into listbox1
Please advise how we can this this.
Thanks
Rich (BB code):
Private Sub FindTheValue_Click()
If TextBox1.Value = "" Then
MsgBox "PLEASE TYPE A VALUE TO SEARCH FOR", vbCritical + vbOKOnly, "SEARCH BOX IS EMPTY"
TextBox1.SetFocus
Else
Set Rng = ws.Range("A5:AB3000").Find(Me.TextBox1.Value, Rng) ' RANGE TO LOOK IN & TEXTBOX NAME FOR WHAT TO LOOK FOR
If Not Rng Is Nothing Then
ws.Activate
Rng.Select
Else
MsgBox "NOTHING TO MATCH THE SEARCH VALUE", vbCritical, "VALUE NOT FOUND MESSAGE"
Exit Sub
End If
End If
End Sub