怎么样获取文字内的数字
For i = 1 To Len(a)
d = Mid(a, i, 1)
If Asc(d) < 0 Then
c = c & d
ElseIf d = Chr(10) Then
c = c & vbCrLf
End If
Next
这行代码可以吧 文本的 汉字提取出来
我还想把 汉字内的数字(除开字母)也提取出来
有什么办法?
i1 = Split(a, vbCrLf)
For i2 = 0 To UBound(i1)
a1 = ""
For i = 1 To Len(i1(i2))
d = Mid(i1(i2), i, 1)
If Asc(d) < 0 Then
a1 = a1 & i & " "
a2 = i
a3 = Split(a1, " ")
End If
Next
b1 = b1 & Mid(i1(i2), a3(0), a2) & vbCrLf
ss = ""
For i3 = 1 To Len(b1)
b2 = Mid(b1, i3, 1)
If Asc(b2) < 0 Or Asc(b2) >= 48 And Asc(b2) <= 57 Then
ss = ss & b2
ElseIf b2 = Chr(10) Then
ss = ss & vbCrLf
End If
Next
Next
感谢各位大神 最终我还是用最原始方法解决来了
[此贴子已经被作者于2018-12-29 20:39编辑过]