不知可是这个: Public Function Escape(ByVal strText As String) As String Set JS = CreateObject("msscriptcontrol.scriptcontrol") JS.Language = "JavaScript" Escape = JS.Eval("encodeURI('" & Replace(strText, "'", "\'") & "');") End Function错了莫怪,我是菜鸟
这个函数,我是在excelhome看到的。 在VBA中好用。
VBA中自己没有encodeURI类似功能的函数,上述 Function Escape是移花接木,但好用。
Public Function Escape(ByVal strText As String) As String
Set JS = CreateObject("msscriptcontrol.scriptcontrol")
JS.Language = "JavaScript"
Escape = JS.Eval("encodeURI('" & Replace(strText, "'", "\'") & "');")
End Function错了莫怪,我是菜鸟
在VBA中好用。
Function Escape是移花接木,但好用。