excel如何在每行下插入固定的行数?
1个回答
展开全部
Sub 宏1()
Dim iRows As Long
Application.ScreenUpdating = False
iRows = 1
Do While Range("a" & iRows + 1) <> ""
iRows = iRows + 1
Rows(iRows & ":" & iRows).Select
Selection.Insert Shift:=xlDown, CopyOrigin:=xlFormatFromLeftOrAbove
iRows = iRows + 1
Loop
Application.ScreenUpdating = True
End Sub
其中的 1 为行数,如你要隔几行插入几行,自行修改
Dim iRows As Long
Application.ScreenUpdating = False
iRows = 1
Do While Range("a" & iRows + 1) <> ""
iRows = iRows + 1
Rows(iRows & ":" & iRows).Select
Selection.Insert Shift:=xlDown, CopyOrigin:=xlFormatFromLeftOrAbove
iRows = iRows + 1
Loop
Application.ScreenUpdating = True
End Sub
其中的 1 为行数,如你要隔几行插入几行,自行修改
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询