|
- Sub splita()
- Dim i&, j&, k&, m&
- Dim arr, brr, ar
- Application.ScreenUpdating = False
- With Sheets("源表")
- arr = .[a1].CurrentRegion
- ReDim brr(1 To 10000, 1 To 7)
- For i = 1 To UBound(arr)
- If InStr(arr(i, 1), "、") Then
- ar = Split(arr(i, 1), "、")
- For j = 0 To UBound(ar)
- k = k + 1
- brr(k, 1) = ar(j)
- For m = 2 To 7
- brr(k, m) = arr(i, m)
- Next
- Next
- Else
- k = k + 1
- For m = 1 To 7
- brr(k, m) = arr(i, m)
- Next
- End If
- Next
- End With
- With Sheets("结果").[k1]
- .Resize(k, 7) = brr
- With .CurrentRegion
- .Borders.LineStyle = 1
- .HorizontalAlignment = xlCenter
- End With
- .Range("A:A").HorizontalAlignment = xlLeft
- End With
- Application.ScreenUpdating = True
- End Sub
复制代码 代码如上。
|
|