|
赚点财富吧,不符合答题要求,直接在原代码修改的- Private Sub CommandButton1_Click()
- Dim r&, ar(), br(), i&, reg, m%, a
- Set reg = CreateObject("vbscript.regexp")
- r = Cells(Rows.Count, 1).End(xlUp).Row
- If r < 2 Then Exit Sub
- ar = Range("A1").Resize(r)
- ReDim br(2 To r, 1 To 1)
- reg.Pattern = "(\d)\e+(\d)"
- For i = 2 To r
- Do While reg.test(ar(i, 1))
- m = reg.Execute(ar(i, 1))(0).Length - 2
- a = Application.Rept(2, m)
- ar(i, 1) = reg.Replace(ar(i, 1), "$1" & a & "$2")
- Loop
- br(i, 1) = ar(i, 1)
- Next
- Range("b2").Resize(r - 1) = br
- End Sub
复制代码 |
评分
-
1
查看全部评分
-
|