函数复杂
直接用代码完成
Sub 分段()
Dim i As Long, j As Long
Dim iRow As Long, lastRow
iRow = Range("B65536").End(xlUp).Row
Range("D2:D" & iRow) = "=C2-B2+1"
lastRow = 2
For i = 2 To iRow
For j = 1 To Cells(i, "D").Value
Cells(lastRow, "A") = Cells(i, "B") + j - 1
lastRow = lastRow + 1
Next j
Next i
Columns("d") = ""
End Sub