+ Reply to Thread
Results 1 to 2 of 2

Pulling up the Find and Replace Dialog via Code

  1. #1
    Forum Contributor kraljb's Avatar
    Join Date
    05-26-2004
    Location
    Illinois
    MS-Off Ver
    2007 (recent change)
    Posts
    256

    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

  2. #2
    Dave Peterson
    Guest

    Re: 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 to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1