- Sub yy()
- Dim ReGe As Object, Arr As Variant
- Dim a As Variant, b As Variant, c As Long
- Set ReGe = CreateObject("VbsCript.RegeXp")
- With ReGe
- .Global = True
- .Pattern = """CORPNAME"":""(.*?)"".*?""SCORE"":(\d*\.?\d+)"
- Set a = .Execute([a1].Value)
- ReDim Arr(1 To a.Count, 1 To 2)
- For Each b In a
- c = c + 1
- Arr(c, 1) = b.submatches(0)
- Arr(c, 2) = b.submatches(1)
- Next b
- End With
- Range("B16").Resize(c, 2) = Arr
- End Sub
复制代码 |