Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I am creating a simple macro that just needs to select a certain range
of cells and then open the Replace & Find window to allow the user to enter their Find & Replace criteria (it will change every time they run the macro. I found the code to do a replace if it was the same replace every time, but cannot find a way to open the window... Any advice would truly be appreciated! |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
This should work for you:
Regards, David Miller Function FindAndReplace() Dim MenuBar As CommandBar, _ Edit As CommandBarControls, _ Replace As CommandBarControl On Error Resume Next Set MenuBar = Application.CommandBars("Worksheet menu bar") Set Edit = MenuBar.Controls.Item("Edit").Controls Set Replace = Edit.Item("Replace...") If Not Replace Is Nothing Then Replace.Execute End If Set Replace = Nothing Set Edit = Nothing Set MenuBar = Nothing End Function |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
assuming you didn't change the short cut key assignment, one way to do it is
to use SendKeys. Application.SendKeys "^h" -- Hope that helps. Vergel Adriano " wrote: I am creating a simple macro that just needs to select a certain range of cells and then open the Replace & Find window to allow the user to enter their Find & Replace criteria (it will change every time they run the macro. I found the code to do a replace if it was the same replace every time, but cannot find a way to open the window... Any advice would truly be appreciated! |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Give this a try...
Application.Dialogs(xlDialogFormulaReplace).Show -- HTH... Jim Thomlinson " wrote: I am creating a simple macro that just needs to select a certain range of cells and then open the Replace & Find window to allow the user to enter their Find & Replace criteria (it will change every time they run the macro. I found the code to do a replace if it was the same replace every time, but cannot find a way to open the window... Any advice would truly be appreciated! |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Thanks Jim,
That worked perfectly! On May 8, 8:38 am, Jim Thomlinson <James_Thomlin...@owfg-Re-Move- This-.com wrote: Give this a try... Application.Dialogs(xlDialogFormulaReplace).Show -- HTH... Jim Thomlinson " wrote: I am creating a simple macro that just needs to select a certain range of cells and then open the Replace & Find window to allow the user to enter their Find & Replace criteria (it will change every time they run the macro. I found the code to do a replace if it was the same replace every time, but cannot find a way to open the window... Any advice would truly be appreciated!- Hide quoted text - - Show quoted text - |
#6
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Nice method Jim, I have never seen that before.
David Miller |
#7
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
All of the dialogs that you can access in XL can be shown via this type of
code. The list of dialogs is very long and worht a look. Eveything from Save As and Print to the color pallete... -- HTH... Jim Thomlinson "Dave Miller" wrote: Nice method Jim, I have never seen that before. David Miller |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Find & replace window | Excel Worksheet Functions | |||
'Match' field in Find and Replace window | Excel Discussion (Misc queries) | |||
find window open cant scroll a worksheet | Excel Worksheet Functions | |||
Find/Replace in VBE takes focus off window Excel 2003 | Excel Programming | |||
Use Macro to open "Find" window | Excel Programming |