|
参与一下。。。- Sub ykcbf() '//2024.1.25
- Dim arr, brr
- Application.ScreenUpdating = False
- Application.DisplayAlerts = False
- r = Me.Cells(Rows.Count, "a").End(xlUp).Row
- arr = Me.Range("a1:b" & r)
- On Error Resume Next
- For i = 2 To UBound(arr)
- If arr(i, 1) = Empty Then
- arr(i, 2) = Empty
- Else
- If InStr(CStr(arr(i, 1)), ",") = 0 Then
- arr(i, 2) = CStr(arr(i, 1))
- Else
- st = ""
- b = Split(CStr(arr(i, 1)), ",")
- For j = 0 To UBound(b)
- st = st & "," & Chr(10)
- Next
- arr(m, 2) = Mid(st, 2)
- End If
- End If
- Next
- Me.Columns("A:B").NumberFormatLocal = "@"
- Me.Range("a1:b" & r) = arr
- Application.ScreenUpdating = True
- MsgBox "OK!"
- End Sub
复制代码
|
|