+ Reply to Thread
Results 1 to 2 of 2

Looping through values to Replace

  1. #1
    Registered User
    Join Date
    05-16-2012
    Location
    New York
    MS-Off Ver
    Excel 2010
    Posts
    1

    Looping through values to Replace

    I'd like to write a loop script to take out:
    -IC
    -MR
    -(Spaces)

    Function Data_Strip(txName As String)
    Data_Strip = Replace(Replace(Replace(txName, "(IC)", "", 1), "Mr. ", "", 1), " ", "", 1)
    End Function

  2. #2
    Registered User
    Join Date
    06-11-2012
    Location
    USA
    MS-Off Ver
    Excel 2010
    Posts
    46

    Re: Looping through values to Replace

    Well, I am confused, because it looks like the title of your post indicates that you want to replace values, but the body of your post looks like you want to just clear out the values. But nobody's answered you, so here is the formula I do to loop a find and replace with multiple finds and multiple replacements, as well as the formula I use to find and clear. This code is for Excel 2007. You may or may not have to tweak it for 2010. But at least it's somewhere to start. I used Column B in the first worksheet, for my example code. You'll have to set your own worksheet and range. I used brackets to indicate where you should place your own replacement values at. Delete the brackets, when you type your own values in there.


    Code if you're trying to Find and Replace

    Please Login or Register  to view this content.

    Code to Find and Clear Contents of Cell

    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