|
参与一下。。。
- Sub ykcbf() '//2024.8.18 拆分
- With Sheets("Sheet1")
- r = .Cells(Rows.Count, 1).End(3).Row
- arr = .[a1].Resize(r, 1)
- .[b2].Resize(r, 100) = ""
- For i = 2 To UBound(arr)
- st = Split(arr(i, 1), ",")
- n = 1
- For x = 0 To UBound(st)
- n = n + 1
- .Cells(i, n) = st(x)
- Next
- Next
- End With
- End Sub
- Sub ykcbf2() '//2024.8.18 合并
- With Sheets("Sheet1")
- r = .Cells(Rows.Count, 2).End(3).Row
- arr = .[a1].Resize(r, 100)
- For i = 2 To UBound(arr)
- st = ""
- For j = 2 To UBound(arr, 2)
- If arr(i, j) <> Empty Then
- st = st & "," & arr(i, j)
- End If
- Next
- .Cells(i, 1) = Mid(st, 2)
- Next
- End With
- End Sub
复制代码
|
|