How to convert text containing html entities to normal text in an excel macro ?
Posted on 2003-03-26
I have the following macro in Excel which I use to convert text with special characters to html entities like (&#xxxx;):
Dim rng As Range
Dim i As Integer
Dim strValue As String
For Each rng In ActiveSheet.UsedRange.Cells
If Not rng.HasFormula Then
strValue = ""
For i = 1 To Len(rng.Value)
If Asc(Mid(rng.Value, i, 1)) >= 32 And Asc(Mid(rng.Value, i, 1)) <= 123 Then
strValue = strValue & Mid(rng.Value, i, 1)
strValue = strValue & "&#" & Format(Asc(Mid(rng.Value, i, 1)), "000") & ";"
rng.Value = strValue
Now i'd like to get the exactly reverse macro which can convert text encoded in html with html entities like (&#xxxx;) to normal text with special characters as ("à" or "ö") ???
Thanx for any help.