答:利用VBA ,我写了段如下代码:
Sub Demo()
Dim Cell As Range
Dim Arr As Variant
Set Cell = Range("D2")
Do Until IsEmpty(Cell)
Arr = Split(Cell, ",")
If UBound(Arr) > 0 Then
Range(Cell.Offset(1, 0), Cell.Offset(UBound(Arr), 0)).EntireRow.Insert
Range(Cell, Cell.Offset(UBound(Arr), 0)).EntireRow.FillDown
Range(Cell, Cell.Offset(UBound(Arr), 0)) = Application.Transpose(Arr)
End If
Set Cell = Cell.Offset(UBound(Arr) + 1)
Loop
End Sub
运行前示例图:
运行后图: