本帖最后由 JLxiangwei 于 2013-5-11 16:37 编辑
都没有人做呢
'======================================
Sub 提取()
Dim regex As Object
Dim arr, arr1(1 To 10000, 1 To 2), x, k, matches, match, k1
arr = Range("a1").CurrentRegion
With CreateObject("VBSCRIPT.REGEXP")
.Global = True
.Pattern = "P\d{6}"
For x = 2 To UBound(arr)
Set matches = .Execute(arr(x, 2))
k1 = 0
For Each match In matches
k = k + 1
k1 = k1 + 1
arr1(k, 1) = arr(x, 1) & "-" & k1
arr1(k, 2) = match
Next
Next
End With
Range("d:e").ClearContents
Range("d:d").NumberFormat = "@"
Range("d2").Resize(k, 2) = arr1
End Sub
'============================================
求助.rar
(12.22 KB, 下载次数: 551)