ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Create a find form in a worksheet (https://www.excelbanter.com/excel-discussion-misc-queries/104357-create-find-form-worksheet.html)

jking80

Create a find form in a worksheet
 
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?

raypayette

Create a find form in a worksheet
 

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 Sub


--
raypayette


------------------------------------------------------------------------
raypayette's Profile: http://www.excelforum.com/member.php...o&userid=29569
View this thread: http://www.excelforum.com/showthread...hreadid=570499



All times are GMT +1. The time now is 12:28 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com