|
[广告] Excel易用宝 - 提升Excel的操作效率 · Excel / WPS表格插件 ★ 免费下载 ★ ★ 使用帮助★
Sub 测试()
Dim ss, k
Set reg = CreateObject("vbscript.regexp")
With reg
.Global = True
.Pattern = "\d+\.\d+"
For Each ss In Range("A1", Cells(Rows.Count, "A").End(xlUp))
Set sj = .Execute(ss)
If sj.Count = 3 Then
n = 0
For Each ss1 In sj
n = n + 1
If VBA.IsNumeric(ss1) Then
ss.Offset(0, n) = ss1 + 0
Else
ss.Range("a" & k).Offset(0, n) = ss1
End If
Next
Else
n = -1
For Each ss1 In sj
n = n + 2
If VBA.IsNumeric(ss1) Then
ss.Offset(0, n) = ss1 + 0
Else
ss.Range("a" & k).Offset(0, n) = ss1
End If
Next
End If
Next
End With
End Sub
|
|