+ Reply to Thread
Results 1 to 3 of 3

macro find&replace only exact value

  1. #1
    Registered User
    Join Date
    09-20-2009
    Location
    Netherlands
    MS-Off Ver
    Excel 2007
    Posts
    18

    Question macro find&replace only exact value

    Hi Everyone,

    This macro finds and replaces multiple values found on another sheet. however, it does not only take the exact value, also others.
    Example:

    If i want to change "Example 1", "Example 2", ... "Example 10" into "One", "two", etc

    Example 10 then changes into "One 0" because it changes the Example 1 (without the 0 in 10) into One.

    Is there any way to alter this (or do you have another macro to replace multiple values?

    Thanks in advance!

    Please Login or Register  to view this content.
    Last edited by DMR1712; 09-25-2009 at 06:05 AM. Reason: solved

  2. #2
    Forum Guru
    Join Date
    03-02-2006
    Location
    Los Angeles, Ca
    MS-Off Ver
    WinXP/MSO2007;Win10/MSO2016
    Posts
    12,657

    Re: macro find&replace only exact value

    Maybe you could add the: "LookAt:= xlWhole" parameter in the find/replace function or, you might be able to verify that the lengths of the two string are equal.
    Ben Van Johnson

  3. #3
    Registered User
    Join Date
    09-20-2009
    Location
    Netherlands
    MS-Off Ver
    Excel 2007
    Posts
    18

    Smile [SOLVED] macro find&replace only exact value

    I found a solution (although xlWhole could work too):

    if anyone needs this, this is the macro:

    Please Login or Register  to view this content.

+ 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