📜  在行后添加特定数量的行 - 无论代码示例

📅  最后修改于: 2022-03-11 14:57:58.384000             🧑  作者: Mango

代码示例1
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