+ Reply to Thread
Results 1 to 6 of 6

Excel Replace Function with wild card: Possible?

  1. #1
    Registered User
    Join Date
    12-13-2011
    Location
    India
    MS-Off Ver
    Excel 2010
    Posts
    47

    Excel Replace Function with wild card: Possible?

    Hi Everyone,

    I'm new to excel and I have column of data that has a lot of html tags encapsulating my text, I can use the Find & Replace tool with a wild card but the problem is I have to manually do a find & replace for all tags except <br><li><ul></li></ul>.

    I need to make a Replace function that replaces all other tags with ""except those above. I tried using the replace function like so

    Please Login or Register  to view this content.
    but it dint work can someone help me? remove all other tags <*> except <br><li><ul>

  2. #2
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: Excel Replace Function with wild card: Possible?

    A few options (regular expressions, iteration etc etc), however, below is one route... the sub routine would be applied to active selection when invoked:

    Please Login or Register  to view this content.
    note: this will alter original values (test on a copy of your real data)

  3. #3
    Registered User
    Join Date
    12-13-2011
    Location
    India
    MS-Off Ver
    Excel 2010
    Posts
    47

    Re: Excel Replace Function with wild card: Possible?

    Quote Originally Posted by DonkeyOte View Post
    A few options (regular expressions, iteration etc etc), however, below is one route... the sub routine would be applied to active selection when invoked:

    Please Login or Register  to view this content.
    note: this will alter original values (test on a copy of your real data)
    :O wow this is awesome. WORKS AMAZINGLY can u direct me to where I can read more about these .xCAl macro code so I can understand better?

  4. #4
    Forum Expert
    Join Date
    12-23-2006
    Location
    germany
    MS-Off Ver
    XL2003 / 2007 / 2010
    Posts
    6,326

    Re: Excel Replace Function with wild card: Possible?

    Don't quote whole posts -- it's just clutter.

    If you are responding to a post out of sequence, limit quoted content to a few relevant lines that makes clear to whom and what you are responding.

  5. #5
    Forum Expert mikerickson's Avatar
    Join Date
    03-30-2007
    Location
    Davis CA
    MS-Off Ver
    Excel 2011
    Posts
    6,229

    Re: Excel Replace Function with wild card: Possible?

    Alternatly, you could use this UDF with a formula like
    =SubstituteLike(A1, "<*>", "", "<br>", "<li>", "</li>", "<ul>", "</ul>")

    Please Login or Register  to view this content.
    _
    ...How to Cross-post politely...
    ..Wrap code by selecting the code and clicking the # or read this. Thank you.

  6. #6
    Registered User
    Join Date
    12-13-2011
    Location
    India
    MS-Off Ver
    Excel 2010
    Posts
    47

    Re: Excel Replace Function with wild card: Possible?

    mikeerickson!! yours is handy as well when I have other tags to remove that are not <> thanks !! you saved me the trouble of posting another thread

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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