Sub a() n = ActiveCell.Offset(0, 0).Value - ActiveCell.Offset(1, 0).Value - 1 ActiveCell.Offset(1).Select For i = 1 To n Selection.EntireRow.Insert , CopyOrigin:=xlFormatFromLeftOrAbove ActiveCell.Offset(0, 0).Value = ActiveCell.Offset(-1, 0).Value - (n - i + 1) Next End Sub
时间: 2024-10-12 16:55:16