- Sub test()
- Dim r%, i%
- Dim arr, brr
- With Worksheets("sheet1")
- r = .Cells(.Rows.Count, 27).End(xlUp).Row
- arr = .Range("aa21:ai" & r)
- ReDim brr(1 To UBound(arr), 1 To 8)
- For i = 1 To UBound(arr)
- xm = Split(arr(i, 8), "*")
- brr(i, 1) = Replace(arr(i, 8), "*", "x")
- brr(i, 2) = xm(0)
- brr(i, 3) = xm(1)
- brr(i, 4) = xm(2)
- brr(i, 5) = arr(i, 4) & "(" & arr(i, 5) & ")" & arr(i, 7) & "#" & arr(i, 8)
- brr(i, 6) = arr(i, 1) & "-" & arr(i, 7)
- brr(i, 7) = arr(i, 2) & "-" & arr(i, 7)
- brr(i, 8) = arr(i, 3) & "-" & arr(i, 7)
- Next
- .Range("a21").Resize(UBound(brr), UBound(brr, 2)) = brr
- End With
- End Sub
复制代码 |