❶ 文字和数字分开。例如把数字和文字连在一起的一段字分成文字和数字分开
Sub Macro1()
'
' Macro1 Macro
' 宏由 DannyNie 录制,时间: 2012-7-3
'
k = 2
j = 1
m = 0
For i = 1 To Len(Cells(1, 1))
If Asc(Mid(Cells(1, 1), i, 1)) > 47 And Asc(Mid(Cells(1, 1), i, 1)) < 58 And m = 0 Then
Cells(k, 1) = Mid(Cells(1, 1), j, i - j)
j = i
m = 1
Else
If (Asc(Mid(Cells(1, 1), i, 1)) < 47 Or Asc(Mid(Cells(1, 1), i, 1)) > 58) And m = 1 Then
Cells(k, 2) = Mid(Cells(1, 1), j, i - j)
j = i
m = 0
k = k + 1
End If
End If
Next i
End Sub