vba unescape

2014年3月24日

Function unescape(strUnEscape As String) As String
Dim result As String, i As Long
i = 1
result = “”
Do While i <= Len(strUnEscape)
If (Mid(strUnEscape, i, 1)) = “%” Then
result = result + Chr(Application.WorksheetFunction.Hex2Dec(Mid(strUnEscape, 1 + i, 2)))
i = i + 3
Else
result = result + Mid(strUnEscape, i, 1)
i = i + 1
End If
Loop
unescape = result
End Function

 

不错的用处,提高不少工作效率!

声明: 本文采用 BY-NC-SA 协议进行授权. 转载请注明转自: vba unescape
本文的评论功能被关闭了.