|
代码如下:- Sub ykcbf() '//2024.3.1
- ReDim brr(1 To 10000, 1 To 3)
- With Sheets("source data")
- arr = .UsedRange
- For i = 2 To UBound(arr)
- st = WorksheetFunction.Trim(arr(i, 2))
- b = Split(st, "/")
- For x = 0 To UBound(b) - 1
- m = m + 1
- brr(m, 1) = arr(i, 1)
- brr(m, 2) = Trim(b(x))
- brr(m, 3) = Trim(b(x + 1))
- Next
- Next
- End With
- With Sheets("analyzing")
- .UsedRange.Offset(1).Clear
- .Cells.Interior.ColorIndex = 0
- With .[a2].Resize(m, 3)
- .Value = brr
- .Borders.LineStyle = 1
- .HorizontalAlignment = xlCenter
- .VerticalAlignment = xlCenter
- End With
- .[a1].Resize(1, 3).Interior.Color = 49407
- .[a2].Resize(m, 1).Interior.Color = 5296274
- End With
- MsgBox "OK!"
- End Sub
复制代码
|
|