+ Reply to Thread
Results 1 to 3 of 3

Need VBA code to remove all HTML from a cell

  1. #1
    Registered User
    Join Date
    02-01-2010
    Location
    Stirling, Scotland
    MS-Off Ver
    Excel 2013
    Posts
    21

    Need VBA code to remove all HTML from a cell

    Hi Guys,

    I have a problem and need a solution.

    I have multiple lines in my spreadsheet where cells have alot of HTML (this is an HTML Template for eBay) What i need to do is remove all the HTML from the cell so that just the plain text is left.
    I've tried doing a find and replace using <*> but this doesn't remove everything, there's always bits of HTML left over.

    I need something that i can store in my Personal.xlsb so i ca use on any workbook as i have this alot.

    Can somebody please help me. Also i could do we having it so if the HTML specifies the text is on the next line down the format stays.

    Hope this makes sense.

    Thanks in advance.

  2. #2
    Valued Forum Contributor Parth007's Avatar
    Join Date
    12-01-2014
    Location
    Banglore
    MS-Off Ver
    2010
    Posts
    876

    Re: Need VBA code to remove all HTML from a cell

    Hello can you share a sample file...
    Regards
    Parth

    I appreciate your feedback. Hit * if u Like.
    Rules - http://www.excelforum.com/forum-rule...rum-rules.html

  3. #3
    Forum Contributor
    Join Date
    10-13-2012
    Location
    Southern California
    MS-Off Ver
    Excel 2007
    Posts
    401

    Re: Need VBA code to remove all HTML from a cell

    Instead of trying to "remove" the HTML, I think it might be MUCH easier to search thru the html code and simply find the text you want and then save this text. You would either save the data to a file or save the data to another worksheet tab or whatever. You could then delete the entire html code, after your data is saved.

    Same result, of course, but most likely this alternative is easier to accomplish.

    As an example, a few days ago I wrote some code to search for old NFL scores at the nfl.com website. To get the scores I had to parse a bunch of html data. All I wanted were the actual scores, of course. I can't even begin to think of how I would have coded it my program to REMOVE the html code. It was much easier to just search that code for the scores I needed.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. how to import html code with no name into worksheet cell?
    By Ja Zee in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 09-27-2015, 07:12 PM
  2. Entering HTML code into Excel cell
    By asem_22 in forum Excel General
    Replies: 0
    Last Post: 09-10-2014, 04:21 PM
  3. Combine cell content into an html code?
    By jake5 in forum Excel - New Users/Basics
    Replies: 1
    Last Post: 06-03-2013, 01:40 AM
  4. Please help with a =SUBSTITUTE formula with html code in the cell
    By rcheltrvel in forum Excel Formulas & Functions
    Replies: 11
    Last Post: 05-12-2013, 06:01 PM
  5. Cell with HTML Code
    By Bnkeane in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 01-23-2008, 10:31 AM
  6. Remove html markup tags in an EXCEL cell?
    By glennwhite in forum Excel General
    Replies: 3
    Last Post: 06-05-2006, 02:30 AM
  7. [SOLVED] How do I display html code within a cell?
    By John-Raritan in forum Excel General
    Replies: 6
    Last Post: 10-31-2005, 12:05 PM

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