Bring up the "find and replace" window

E

excel

When the workbook is opened, I'd like to be prompted to search and
replace. I know that the "macro" needs to be saved as a
"Workbook_open" subroutine. But I don't know how to get it then
prompt for the string to be searched for. The macro recorder records
nothing when I hit Ctrl+F. What's the code for bringing up the Search
and replace window?

Thanks,
 
E

excel

does this help?

Application.Dialogs(xlDialogFormulaFind).Show

--

Gary







- Show quoted text -

Thanks Gary -- yes that worked.
1) How would I go about figuring this out myself -- other than asking
this newsgroup?
2) I'm trying to limit the scope of the search to column H. so, I did
this:
Columns("H:H").Select
Application.Dialogs(xlDialogFormulaFind).Show

But it searches in the whole sheet. How can I limit the search to
just column H?

Thanks,
 
G

Gary Keramidas

i'm guessing you'll have to make your own. create a form with 2 textboxes. one
with what you want to search for and one with what you want to replace it with.

then search vba help for the find method, when you find what you're looking for
in textbox1, replace it with textbox2.
 

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