+ Reply to Thread
Results 1 to 5 of 5

Find/Replace Macro Using Replace Table

  1. #1
    Registered User
    Join Date
    05-12-2010
    Location
    United States
    MS-Off Ver
    Excel 2007
    Posts
    42

    Find/Replace Macro Using Replace Table

    Hey folks,

    I’m attempting to create a Find/Replace macro where I can populate the lookups/replacement into a table and then run the macro on a range finding the values from my table and replace them accordingly.

    Here is an example:

    I have a range with the following values:
    Mélanie Fiona
    Céline Dion
    Selena Gomez & The Scene
    I have a range of replacement values stored in a table in the following manner:

    Column A
    é
    &

    Column B
    e
    And


    I’m looking to build a macro that will search for the values in Column A from my table and replace them with the value of Column B on a specified range.

    I’m currently using the following macro as a direct replacement.

    Please Login or Register  to view this content.

    Any help would be appreciated.
    Last edited by LampCommandr; 10-24-2011 at 11:01 AM.

  2. #2
    Forum Expert tigeravatar's Avatar
    Join Date
    03-25-2011
    Location
    Colorado, USA
    MS-Off Ver
    Excel 2003 - 2013
    Posts
    5,361

    Re: Find/Replace Macro Using Replace Table

    LampCommandr,

    The following macro should work for you. The first prompt is asking you to select the range of cells that contains the text to look for and their associated replacement values. The second prompt is asking you to select the range that needs the replacements:
    Please Login or Register  to view this content.
    Hope that helps,
    ~tigeravatar

    Forum Rules: How to use code tags, mark a thread solved, and keep yourself out of trouble

  3. #3
    Registered User
    Join Date
    05-12-2010
    Location
    United States
    MS-Off Ver
    Excel 2007
    Posts
    42

    Re: Find/Replace Macro Using Replace Table

    Thanks for the response Tiger.

    I adjusted the code to reflect what I'm working with in the following manner:

    Please Login or Register  to view this content.
    The table of values with the replacements exists on one tab and the content to check is in another.

    The issue I'm running into is that when I run the macro, all values change to one. Any idea why?

    I've attached an example. Thanks in advance.
    Attached Files Attached Files

  4. #4
    Forum Expert tigeravatar's Avatar
    Join Date
    03-25-2011
    Location
    Colorado, USA
    MS-Off Ver
    Excel 2003 - 2013
    Posts
    5,361

    Re: Find/Replace Macro Using Replace Table

    LampCommandr,

    Modified code, give this a try:
    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    05-12-2010
    Location
    United States
    MS-Off Ver
    Excel 2007
    Posts
    42

    Re: Find/Replace Macro Using Replace Table

    Worked like a charm! Thanks!

+ 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