|
楼主是高人呀,赞一个。
帮了我一个大忙,我利用楼主的理论,写了一个Excel中删除所有非打印字符的函数共勉。
Function Clean_A(ByVal sContent As String) As String
Dim i As Integer
Dim sTmp As String
sTmp = sContent
For i = 1 To 31
sTmp = Replace(sTmp, Chr(i), Chr(32))
Next i
sTmp = Replace(sTmp, Chr(127), Chr(32)) '(值为127、129、141、143、144和157)。
sTmp = Replace(sTmp, Chr(129), Chr(32))
sTmp = Replace(sTmp, Chr(141), Chr(32))
sTmp = Replace(sTmp, Chr(143), Chr(32))
sTmp = Replace(sTmp, Chr(144), Chr(32))
sTmp = Replace(sTmp, Chr(157), Chr(32))
sTmp = Replace(sTmp, Chr(160), Chr(32))
Clean_A = Trim(sTmp)
End Function |
|