这可以满足您的要求,如果 32 之后有任何行,则将它们向下移动:
Sub MoveRowsDown()
Dim NumRows As Long
Dim TargetRow As Long
Dim ws As Excel.Worksheet
NumRows = 7 'change as necessary
TargetRow = 33 'change as necessary
Set ws = ActiveSheet ' change as necessary
ws.Range("A1").Resize(NumRows).EntireRow.Cut
ws.Range("A" & TargetRow + NumRows).EntireRow.Insert shift:=xlDown
End Sub
编辑:这是一个只是剪切和粘贴的版本,没有花哨的插入:
Sub MoveRowsDown()
Dim NumRows As Long
Dim TargetRow As Long
Dim ws As Excel.Worksheet
NumRows = 7 'change as necessary
TargetRow = 33 'change as necessary
Set ws = ActiveSheet ' change as necessary
ws.Range("A1").Resize(NumRows).EntireRow.Cut Destination:=ws.Range("A" & TargetRow)
End Sub