Hi,
I used a macro to convert html to plain text and it does the job great but I want to leave the html tag <CTRL> in the text.
Can I exclude this?
The script I used is:
Sub StripTags()
' adapted from Rick Rothestein at
' http://groups.google.com/group/micro...b8e6462c11746c
Dim cell As Range
Dim s As String
Dim asWd() As String
Dim iWd As Long
For Each cell In Intersect(Selection.Cells, ActiveSheet.UsedRange)
s = Replace(cell.Value, Chr(160), " ")
s = Replace(s, ">", "<")
s = Replace(s, vbCr, vbLf)
asWd = Split(s, "<")
s = vbNullString
For iWd = 0 To UBound(asWd) Step 2
s = s & " " & asWd(iWd)
Next iWd
Do While InStr(s, vbLf & " ")
s = Replace(s, vbLf & " ", vbLf)
Loop
Do While InStr(s, vbLf & vbLf)
s = Replace(s, vbLf & vbLf, vbLf)
Loop
cell.Value = WorksheetFunction.Trim(s)
Next cell
End Sub
Bookmarks