Progmatically set "Application.Dialogs(xlDialogFormulaFind)" optio

R

Rick S.

The bit of code below opens the "find" dialog box with the text supplied by a
textbox on a userform.
sFindMe = TextBox1.Value
Application.Dialogs(xlDialogFormulaFind).Show sFindMe

What I would like to do is set the search arguments and pass an "Enter" key
response with out user interaction to the "find" dialog box.
Basically the user would never see the dialog box at all. Trust me, its
necessary. ;)

Is this possible?
 
B

Bob Phillips

Why not use the VBA find, check it out in Help.

--
---
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)
 
R

Rick S.

Thanks Bob! Allthough I did not fully understand the "VBA Find" use I ended
up with the following code that searches all sheets in the workbook for a
user entered text string via a user form. Turns out I do not need to pass
the "Find Next" value for the find dialog box.

Private Sub CommandButton1_Click()
ActiveSheet.Cells.Select 'set first selection set
sFindMe = TextBox1.Value 'get user value
SearchWorkBook.Hide 'hide userform
Application.Dialogs(xlDialogFormulaFind).Show sFindMe 'start find dialog and
search
End Sub

--
Regards

Rick
XP Pro
Office 2007
 
R

Rick S.

Worms!
The only thing that comes to mind is worms. Do one thing and open a can of
worms on something else. LOL

For and unknown reason (to me), after running the macro, the "Find Dialog
Box" will not open from the ribbon menu or by key commands (CNTRL F).

--
Regards

Rick
XP Pro
Office 2007
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top