Link to home
Start Free TrialLog in
Avatar of Matt Jones
Matt JonesFlag for United States of America

asked on

Stripping HTML from an Excel column and replacing it with plain text

Hi,

I have an Excel file that has a field called "Description".  This field has got HTML in it, and it prints 2-3 HTML formatted lines.  The format includes bulleted lists and bolded/italicized text.

Does someone have a way of converting this ENTIRE column into plain text, i.e. stripping of the HTML completely?
Avatar of wasiftoor
wasiftoor
Flag of United States of America image

You can use the following function

Function HtmlToText(sHTML) As String
  Dim oDoc As HTMLDocument
  Set oDoc = New HTMLDocument
  oDoc.body.innerHTML = sHTML
  HtmlToText = oDoc.body.innerText
End Function

Open in new window

Avatar of Matt Jones

ASKER

Can you please provide some simple steps on how to use this function in Excel 2010? I have an entire column that has the HTML; I want to replace the HTML in every single cell in that column with plain text.
BTW, with this function, what happens to the bulleted lists?
ASKER CERTIFIED SOLUTION
Avatar of wasiftoor
wasiftoor
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Thanks for the excellent response!