Want to create Find macro--with some options

February 17, 2011 at 13:03:51
Specs: Windows XP
I want to create a field in my Excel document that will allow users to enter some text and then be able to click a button and the results of the Find dialogue will appear.

I want the results of the Find to ALWAYS search with the following options:
Within: Workbook
Search: by Rows
Look in: Values
and to "Find All" rather than "Find Next".

I'm familiar with how to create the button based on the Macro. What I don't know how to do is how to write the Macro. Let's say the field into which the text is entered is A1.

Thank you to anyone who's willing to take this on!

See More: Want to create Find macro--with some options

Report •

February 17, 2011 at 20:52:12
As far as I know, you cannot set the options you want directly via VBA.

I've heard rumors that you can do it with SendKeys, but the SendKeys method is known to be troublesome.

I tried this to set the SearchIn option to Workbook and it was terribly intermittent. Certainly not something I would roll out in a production environment.

Sub SetMyFindOptions()
  SendKeys "%(t)%(h)W~{ESC}"
End Sub

Click Here Before Posting Data or VBA Code ---> How To Post Data or Code.

Report •
Related Solutions

Ask Question