我想在Excel工作表中隔行插入行怎么操作??

来源:百度知道 编辑:UC知道 时间:2024/05/29 06:20:50

用VBA吧

Sub hong()
Dim n, i
n = 1
While Not (IsEmpty(Cells(n, 2)))
n = n + 1
Wend

For i = n To 2 Step -1
Rows(i).Select
Selection.Insert Shift:=xlDown, CopyOrigin:=xlFormatFromLeftOrAbove
Next i

End Sub

右键点击插入即可