Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Open the Find & Replace Window Using a Macro

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 72
Default Open the Find & Replace Window Using a Macro

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 857
Default Open the Find & Replace Window Using a Macro

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,939
Default Open the Find & Replace Window Using a Macro

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Open the Find & Replace Window Using a Macro

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 72
Default Open the Find & Replace Window Using a Macro

Nice method Jim, I have never seen that before.

David Miller

  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,939
Default Open the Find & Replace Window Using a Macro

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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Find & replace window DreamKid Excel Worksheet Functions 0 December 10th 09 08:30 PM
'Match' field in Find and Replace window denhamlee Excel Discussion (Misc queries) 0 September 19th 07 02:11 PM
find window open cant scroll a worksheet goatlady Excel Worksheet Functions 0 February 12th 07 06:31 PM
Find/Replace in VBE takes focus off window Excel 2003 ward376 Excel Programming 0 January 18th 07 11:14 PM
Use Macro to open "Find" window supafreeza Excel Programming 1 July 14th 05 02:19 AM


All times are GMT +1. The time now is 04:17 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"