Help with Message Box Information

DEllis

Active Member
Joined
Jun 4, 2009
Messages
344
Office Version
  1. 365
Platform
  1. Windows
I have a form that I put in a part number and hit a search button, I would like for the search result to be a message box that pops up and tells me that part number is on line # whatever (row), and if it is not in the database to say "Part number not found".

Is it possible to locate what row the part number is on and have a message tell me this?

THank you
 

Excel Facts

Pivot Table Drill Down
Double-click any number in a pivot table to create a new report showing all detail rows that make up that number
Something like:

Code:
Sub Search_Click()
Dim PartNum As Range

    On Error Resume Next
    Set PartNum = Sheets("Parts").Range("A:A").Find(textBox_Part, LookIn:=xlValues, LookAt:=xlwhole)

    If PartNum Is Nothing Then
        MsgBox "Part number not found"
    Else
        MsgBox "Part number found on row #" & PartNum.Row
    End If

End Sub
 
Upvote 0
Thank you so much! My brain was just stumped....

Must be the curls or red hair...not sure which, but I appreciate your resolution.

Take care.
DEllis
 
Upvote 0
I see that this question is in the Access Forum, but the response is an Excel response.

So is this actually an Excel question that I should move to the Excel forum?
 
Upvote 0

Forum statistics

Threads
1,224,599
Messages
6,179,831
Members
452,947
Latest member
Gerry_F

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top