|
[广告] Excel易用宝 - 提升Excel的操作效率 · Excel / WPS表格插件 ★ 免费下载 ★ ★ 使用帮助★
Sub limonet()
Dim i%, j%, Ms As Object, S$
With CreateObject("vbscript.regexp")
.Pattern = "(\d)(.*?)(-)?(\d+)?(/)"
.Global = True
For i = 2 To Range("A" & Rows.Count).End(xlUp).Row
Set Ms = .Execute(Cells(i, "A"))
For j = 0 To Ms.Count - 1
If Ms(j) Like "[0-9]*-[0-9]/" Or Ms(j) Like "[0-9]*-[0-9][0-9]/" Then
S = S & Evaluate(.Replace(Ms(j), "$1*$4")) & .Replace(Ms(j), "$2$5")
Else
S = S & Ms(j)
End If
Next j
Cells(i, "B") = S: S = ""
Next i
End With
End Sub
|
评分
-
1
查看全部评分
-
|