|
- Sub kj()
- Dim arr, brr
- Application.ScreenUpdating = False
- Set Sh = ActiveSheet
- Set Sh1 = Sheet1
- With Sh
- arr = .Range("a1:b" & .Cells(.Rows.Count, 1).End(3).Row)
- End With
- ReDim brr(1 To UBound(arr), 1 To 100)
- For i = 1 To UBound(arr)
- m = 0
- s = Split(arr(i, 1), " ")
- For j = 0 To UBound(s)
- If s(j) <> "" Then
- m = m + 1
- brr(i, m) = s(j)
- End If
- Next
- If m > n Then
- n = m
- End If
- Next
- With Sh1
- .Cells.ClearContents
- .Range("a1").Resize(UBound(arr), n) = brr
- End With
- Application.ScreenUpdating = True
- MsgBox "OK!"
- End Sub
复制代码 |
|