hellothere4
New Member
- Joined
- May 9, 2011
- Messages
- 17
Hello, I am trying to HTML encode characters within a cell. I am soo frustrated because search results bring up nothing. please help!
Sub test()
Dim c As Range, x As Long, d As Byte, e As String
For Each c In ActiveSheet.UsedRange
If Not (c.HasFormula) Then
e = c
For x = 1 To Len(c)
d = Asc(Mid(c, x, 1))
If d > 31 And d < 124 Then e = Replace(e, Chr(d), "&#" & Format(d, "000") & ";")
Next x
c = e
End If
Next
End Sub