+ Reply to Thread
Results 1 to 3 of 3

Creating a macro using the RegEx Find/Replace add-in

Hybrid View

  1. #1
    Registered User
    Join Date
    03-23-2012
    Location
    Chicago, Illinois
    MS-Off Ver
    Excel 2007
    Posts
    10

    Creating a macro using the RegEx Find/Replace add-in

    Hello all,

    I'm trying to record a macro that uses the RegEx Find/Replace add-in (downloaded from http://www.codedawn.com/excel-add-ins.php). Unfortunately, the macro does not pick up any of the add-in's operations, even when I add Microsoft VBScript Regular Expressions 5.5 as a VBA reference. Does anyone know how I can go about using an add-in within a Macro recording? I would like to learn enough VBA to figure out how to incorporate regular expressions into the code, but I'm a little pressed for time with this project.

  2. #2
    Valued Forum Contributor
    Join Date
    05-21-2009
    Location
    Great Britain
    MS-Off Ver
    Excel 2003
    Posts
    550

    Re: Creating a macro using the RegEx Find/Replace add-in

    I downloaded and installed that add-in but got errors when opening and closing Excel: System error, and Compile error in hidden module ThisWorkbook. Looking at its help, I think you are meant to use its functions in cell formulae, e.g. =RegExFind(...). The macro recorder should pick up the functions if you type them in during the recording.

    In VBA, although I haven't been able to test this, you should be able to call its functions like this:

    x = Application.WorksheetFunction.RegExFind(...)

    You don't need to set a project reference to Microsoft VBScript Regular Expressions 5.5 to use the add-in's functions.

    For a very simplified alternative to regexes, have a look at the Like operator.
    Post responsibly. Search for excelforum.com

  3. #3
    Registered User
    Join Date
    03-23-2012
    Location
    Chicago, Illinois
    MS-Off Ver
    Excel 2007
    Posts
    10

    Re: Creating a macro using the RegEx Find/Replace add-in

    Thanks for your insight, Chippy.
    Some of the comments on the CodeDawn website indicated that you'll probably receive those kinds of error messages if you're using Excel 2010 64-bit version.
    I'll see what I can do based on your suggestions.
    Last edited by bauman312; 10-24-2012 at 12:59 PM.

+ 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