|
重整一下資料
- Sub zz()
- Dim a, d As Object, b(), k, t, s$
- Set d = CreateObject("scripting.dictionary")
- a = Range("c2:c" & [c65536].End(3).Row)
- With CreateObject("vbscript.regexp")
- .Global = True
- .Pattern = "[\u4e00-\u9fa5]+(?=:)"
- For i = 1 To UBound(a)
- For Each m In .Execute(a(i, 1))
- d(CStr(m)) = ""
- Next
- Next
- k = d.keys
- ReDim b(1 To UBound(a) + 1, 1 To d.Count)
- For j = 1 To UBound(b, 2)
- b(1, j) = k(j - 1): d(k(j - 1)) = j
- Next
- .Pattern = "[\u4e00-\u9fa5]+:.*?(?=;)"
- For i = 1 To UBound(a)
- For Each m In .Execute(a(i, 1))
- t = Split(m, ":")
- b(i + 1, d(CStr(t(0)))) = t(1)
- Next
- Next
- End With
- Workbooks.Add 1
- [a1].Resize(i, d.Count) = b
- End Sub
复制代码
|
评分
-
2
查看全部评分
-
|