Dim x As Integer, y As Integer, z As Integer, n As Integer
z = Sheet6.Range("a65536").End(xlUp).Row '一共有多少行数
y = 3 '根据不同的情形需要调整
For n = 0 To z '控制整体循环的次数
If Cells(y - 1, "B").Value <> 0 Then
rows(y).Resize(Cells(y - 1, "B").Value).Insert
For x = 1 To Cells(y - 1, "B").Value '该循环是为了将插入空行中添加日期
Cells(y, "C").Value = Cells(y - 1, "C").Value
Cells(y, "F").Value = Cells(y - 1, "F").Value
Cells(y, "G").Value = Cells(y - 1, "G").Value
Cells(y, "H").Value = Cells(y - 1, "H").Value
Cells(y, "I").Value = Cells(y - 1, "I").Value
Cells(y, "J").Value = Cells(y - 1, "J").Value
Cells(y, "K").Value = Cells(y - 1, "K").Value
Cells(y, "L").Value = Cells(y - 1, "L").Value
Cells(y, "M").Value = Cells(y - 1, "M").Value
Cells(y, "N").Value = Cells(y - 1, "N").Value
Cells(y, "O").Value = Cells(y - 1, "O").Value
Cells(y, "P").Value = Cells(y - 1, "P").Value
Cells(y, "Q").Value = Cells(y - 1, "Q").Value
Cells(y, "R").Value = Cells(y - 1, "R").Value
Cells(y, "S").Value = Cells(y - 1, "S").Value
Cells(y, "T").Value = Cells(y - 1, "T").Value
Cells(y, "U").Value = Cells(y - 1, "U").Value
Cells(y, "V").Value = Cells(y - 1, "V").Value
Cells(y, "W").Value = Cells(y - 1, "W").Value
Cells(y, "X").Value = Cells(y - 1, "X").Value
Cells(y, "Y").Value = Cells(y - 1, "Y").Value
Cells(y, "Z").Value = Cells(y - 1, "Z").Value
Cells(y, "AA").Value = Cells(y - 1, "AA").Value
Cells(y, "AB").Value = Cells(y - 1, "AB").Value
Cells(y, "AC").Value = Cells(y - 1, "AC").Value
Cells(y, "AD").Value = Cells(y - 1, "AD").Value
Cells(y, "AE").Value = Cells(y - 1, "AE").Value
Cells(y, "A").Value = DateAdd("m", Cells(y - 1, "C").Value, Cells(y - 1, "A").Value) 'dateadd函数直接添加月份
y = y + 1
Next
End If
y = y + Cells(y - 1, "B").Value + 1
Next n