ipbr21054
Well-known Member
- Joined
- Nov 16, 2010
- Messages
- 5,738
- Office Version
- 2007
- Platform
- Windows
Evening.
I am using the code below.
After i have been told that the item exists or does not exist i click on OK and the message box closes.
I then need to click again on the command button3 to show me the box & type in another number.
What i would like is to be able to apply something like userform.show code so it opens again without me doing it each time.
The also have the option to close it manually myself once finished.
I am using the code below.
After i have been told that the item exists or does not exist i click on OK and the message box closes.
I then need to click again on the command button3 to show me the box & type in another number.
What i would like is to be able to apply something like userform.show code so it opens again without me doing it each time.
The also have the option to close it manually myself once finished.
Code:
Private Sub CommandButton3_Click()'Modified 10/14/2018 8:12:52 AM EDT
Application.ScreenUpdating = False
Dim ans As String
Dim rr As Long
Dim LastRow As Long
LastRow = Cells(Rows.Count, "A").End(xlUp).Row
ans = InputBox("Enter search for value")
Set SearchRange = Range("A3:A" & LastRow).Find(ans)
If SearchRange Is Nothing Then MsgBox "The Part Number " & ans & " Is Not In The List", vbCritical: Exit Sub
rr = SearchRange.Row
MsgBox "The Part Number " & ans & " Can Be Found In Row " & rr, vbExclamation
Application.ScreenUpdating = False
End Sub