View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Dave Miller Dave Miller is offline
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