ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Bring up the "find and replace" window (https://www.excelbanter.com/excel-programming/394220-bring-up-find-replace-window.html)

[email protected]

Bring up the "find and replace" window
 
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,


Gary Keramidas

Bring up the "find and replace" window
 
does this help?

Application.Dialogs(xlDialogFormulaFind).Show


--


Gary


wrote in message
oups.com...
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,




[email protected]

Bring up the "find and replace" window
 
On Jul 26, 3:58 pm, "Gary Keramidas" <GKeramidasATmsn.com wrote:
does this help?

Application.Dialogs(xlDialogFormulaFind).Show

--

Gary

wrote in message

oups.com...



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,- Hide quoted text -


- 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,


Gary Keramidas

Bring up the "find and replace" window
 
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.



--


Gary


wrote in message
oups.com...
On Jul 26, 3:58 pm, "Gary Keramidas" <GKeramidasATmsn.com wrote:
does this help?

Application.Dialogs(xlDialogFormulaFind).Show

--

Gary

wrote in message

oups.com...



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,- Hide quoted text -


- 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,





All times are GMT +1. The time now is 02:57 PM.

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