❶ 文字和數字分開。例如把數字和文字連在一起的一段字分成文字和數字分開
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