|
一直没找到,如何判断中文字符、英文字符、数字、其它字符的表达式,请高人指点。
Sub 前面()
Dim gezi As Range
Dim i As Integer
Dim k As Integer
Dim shuzu(1 To 2, 1 To 10000) As String
Dim neirong2 As String
With Worksheets(1)
For i = 1 To 10000
For k = 1 To Len(.Range("a1").Offset(i, 0))
If ask(Mid(.Range("a1").Offset(i, 0), k, 1)) > 0 Then ’此处判断当遇到中文字符时,但不凑效
GoTo 100
Next k
100:
shuzu(1, i) = Mid(.Range("a1").Offset(i, 0), 1, k - 1)
shuzu(2, i) = Mid(.Range("a1").Offset(i, 0), k, Len(.Range("a1").Offset(i, 0)))
Next i
End With
With Worksheets(1)
For i = 1 To 10000
.Range("a1").Offset(i, 0) = shuzu(1, i)
.Range("a1").Offset(i, 1) = shuzu(2, i)
Next i
End With
End Sub
|
|