Create a find form in a worksheet

J

jking80

I have a column of zip codes, and I want to create a find form. I do not
want the user to have to open Excel's find feature, I just want a text box
where you enter the zip code, and then a command button you click. If the
zip code the user enters is in the column, I want it to say YES, if it's not
in there, I want it to say NO.

Can this be done?
 
R

raypayette

Place this in a module (and modify the rows, columns and limit):

Sub FindZip()
z = InputBox("What is the ZIP code?", "ZIP")
For i = 1 To 10
If Cells(i, 1).Text = z Then
MsgBox "YES", vbExclamation, "ZIP found?"
t = True
Exit For
End If
Next
If Not t Then MsgBox "NO", vbExclamation, "ZIP found?"
End Su
 
Top