Search using a Userform


Posted by Paula on May 24, 2001 12:34 PM

Excel 97: I'm a novice writer of macros/visual basic. I have created a userform that will allow the user to enter in the part number, quote number, etc. that they want to find(8 columns of options, undetermined number of rows) . I then have an OK button which would launch the search or a CANCEL button to exit the search. After performing the search, I would like the cell that the item is located in to be the active cell. What's the easiest way to do this? Also, is there a way that I can use a "Find Next" button to find the next occurence of the item? (A macro that would open the Find option on the Edit menu would work for me if there's a way to do that.)



Posted by Dave Hawley on May 24, 2001 8:39 PM


Hi Paula

Yes you can certainly launch the Find dialog very easily. You can also place in the text to look for.

Private Sub CommandButton2_Click()
Application.Dialogs(xlDialogFormulaFind).Show TextBox1.Text
End Sub

Where TextBox1.Text contains the text to look for.


Dave


OzGrid Business Applications