📅  最后修改于: 2022-03-11 14:57:58.384000             🧑  作者: Mango
Sub insertRows()
Dim i As Long
Dim j As Variant
j = InputBox("How many rows would you like to insert?", "Insert Rows")
If j = "" Then
j = 1
End If
For i = 1 To j
ActiveCell.Rows.EntireRow.Select
Selection.Insert Shift:=xlDown, CopyOrigin:=xlFormatFromLeftOrAbove
Next
End Sub