Search value the prompt for user form with three options, place in cell afterwards

Caveman1964

Board Regular
Joined
Dec 14, 2017
Messages
121
Hi,
I want to click macro.
it searches sheet3 A:A for a value. If it doesnt find it, message just says value not present. If it finds it, it pulls up a userform named "goahead", it consists of three choices yes, no, n/a.
whichever one is selected, it places that in sheet3 column z for that particular row. I have a mess with it and starting over, couldn't get to work.
any help is appreciated.
Thanks!
 

Excel Facts

Fastest way to copy a worksheet?
Hold down the Ctrl key while dragging tab for Sheet1 to the right. Excel will make a copy of the worksheet.
I think that it would be easier to help and test possible solutions if I could work with your actual file which includes any macros you are currently using. Perhaps you could upload a copy of your file to a free site such as www.box.com or www.dropbox.com. Once you do that, mark it for 'Sharing' and you will be given a link to the file that you can post here. Include a detailed explanation of what you would like to do using a few examples from your data and referring to specific cells, rows, columns and worksheets. If the workbook contains confidential information, you could replace it with generic data.
 
Upvote 0
Thank you for the response!....unfortunately my work computer has access blocked to the file sharing. I'll try to explain better here.
I click a button that has a text "Return Product"
Prompt asks for Lot number.
It searches A:A for lot number
If it doesn't find it says it doesnt exists and exits sub
if it does, an input box of options shows up with YES, NO, or N/A.
User clicks one of those options and it places it in row of column D.
Then exits or prompts that the users values was placed.
The button will be on sheet 2 that user clicks, the table below that it searches is sheet 3 and places value in sheet 3 without user going to sheet 3
Sorry I couldn't get file on there and if this example doesn't help i definitely appreciate you trying.
Thanks!!!!

ABCD
1Lot NumberProductProblem CodeWill we cancel delivery?
21aS47Yes
32bP68Yes
43cS45No
54dS45N/A
65eP68
76fP91

<tbody>
</tbody>
 
Last edited:
Upvote 0
By "input box" do you mean the userform named "goahead"? If so, are the options YES, NO and N/A assigned to option buttons on the userform? Is the prompt that asks for a Lot Number in the form of an inputbox or is it a textbox on the userform?
 
Last edited:
Upvote 0
yes I did mean that but I don't have to use that userform if a simple excel prompt can have those options. Excel prompt would be easier for me.
The userform is basic right now with no code, only the radio buttons with the Yes, No, N/A
no the prompt for asking for lot number is not in that form.
I am a novice with not much sense about this stuff....lol.....as you see. I think I confused the whole thing by trying to create a userform. excel prompt may be simpler.
Thanks!
 
Upvote 0
Would a Yes, No, Cancel prompt be acceptable, or do you want the prompt to have N/A
 
Upvote 0
Place this macro in a standard module and assign it to the button on Sheet2.
Code:
Sub SearchVal()
    UserForm1.Show
End Sub

You will need a userform with 3 option buttons (YES, NO and N/A) and a commandbutton. Place this macro in the commandbutton code module:
Code:
Private Sub CommandButton1_Click()
    Dim i As Long, response As String, val As Range, oCtl As MSForms.Control
    response = InputBox("Please enter a value to search.")
    If response = "" Then
        Unload UserForm1
        Exit Sub
    End If
    Set val = Sheets("Sheet3").Range("A:A").Find(response, LookIn:=xlValues, lookat:=xlWhole)
    For Each oCtl In Me.Controls
        If oCtl.Value = True Then val.Offset(0, 3) = oCtl.Caption
    Next oCtl
    Unload UserForm1
End Sub
Click a button and then click the commanbutton.
 
Last edited:
Upvote 0

Forum statistics

Threads
1,215,248
Messages
6,123,877
Members
449,130
Latest member
lolasmith

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