試試看
Sub ex()
Dim a As Variant, x As Variant, y%
For Each a In Range([b2], [b65535].End(3))
If a <> "" Then
x = Split(a, "+")
[F2].Offset(y).Resize(UBound(x) + 1) = Application.Transpose(x)
y = y + UBound(x) + 1
Else
y = y + 1
End If
Next
End Sub作者: hcm19522 時間: 2021-3-4 12:59
Sub ex1()
Dim a%, x As Variant
a = 2
Do While Cells(a, 2) <> "" Or Cells(a, 5) <> ""
x = Split(Cells(a, 5), "+")
If UBound(x) > 0 Then '判斷數值組數
Rows(a).Offset(1).Resize(UBound(x)).Insert
Cells(a, 5).Resize(UBound(x) + 1) = Application.Transpose(x)
a = a + UBound(x)
End If
a = a + 1
Loop
End Sub作者: shuo1125 時間: 2021-3-5 19:16