Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Pulling up the Find and Replace Dialog via Code


I have a macro that currently uses the Ctrl-F function, however when the
Macro is unuseable (or going to error out) I would prefer to have the
macro call the Find and Replace Dialog Box. The only hitch is that I
cannot seem to find that dialog box in the list of presets.

Thanks in advance for your help,
John


--
kraljb
------------------------------------------------------------------------
kraljb's Profile: http://www.excelforum.com/member.php...fo&userid=9955
View this thread: http://www.excelforum.com/showthread...hreadid=500379

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default Pulling up the Find and Replace Dialog via Code

For the Find Dialog:

Dim WhatToFind As String
WhatToFind = "asdf"
Application.Dialogs(xlDialogFormulaFind).Show arg1:=WhatToFind

For the Replace dialog

Dim WhatToFind As String
Dim ChangeToWhat As String
WhatToFind = "asdf"
ChangeToWhat = "qwer"
Application.Dialogs(xlDialogFormulaReplace).Show _
arg1:=WhatToFind, arg2:=ChangeToWhat

kraljb wrote:

I have a macro that currently uses the Ctrl-F function, however when the
Macro is unuseable (or going to error out) I would prefer to have the
macro call the Find and Replace Dialog Box. The only hitch is that I
cannot seem to find that dialog box in the list of presets.

Thanks in advance for your help,
John

--
kraljb
------------------------------------------------------------------------
kraljb's Profile: http://www.excelforum.com/member.php...fo&userid=9955
View this thread: http://www.excelforum.com/showthread...hreadid=500379


--

Dave Peterson
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 AND REPLACE DIALOG BOX MoreGOOFS Excel Discussion (Misc queries) 1 June 24th 06 12:46 PM
Excel Find/Replace Dialog Box ajaxford Excel Discussion (Misc queries) 2 June 16th 06 06:28 AM
how to lock the find and replace dialog box in a corner JBK Enterprises Excel Discussion (Misc queries) 0 January 17th 06 04:40 PM
Find/Replace built-in dialog in XP kevboy Excel Programming 2 December 19th 05 08:59 PM
Find and Replace dialog box in VBA doesn't work suddenly Leung Excel Programming 0 May 18th 05 08:04 AM


All times are GMT +1. The time now is 11:48 PM.

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

About Us

"It's about Microsoft Excel"