VBA判断字符是否是数字
Sub jxcSplit()
Dim i As Integer
Dim lastRow As Long
Dim myArray() As String
On Error Resume Next
lastRow = ActiveSheet.UsedRange.row - 1 + ActiveSheet.UsedRange.Rows.Count
With Application
.Calculation = xlCalculationManual
.ScreenUpdating = False
For i = 11 To lastRow Step 1
myArray = Split(Range("A" & i).Value, "-")
Range("A" & i).Value = myArray(0)
If IsNumeric(myArray(1)) Then
Range("A" & i).Value = myArray(0) & "-" & myArray(1)
End If
Next i
.Calculation = xlCalculationAutomatic
.ScreenUpdating = True
End With
End Sub
阅读(11877) | 评论(0) | 转发(0) |