Sub charuhang()
'你所说的假设选中哪一列,其实,插入行和选中的列不相关,
'有用的信息是你所选中的行——起止行号
start = InputBox("请输入要插入行的起始行号:", , 3)
end = InputBox("请输入要插入行的终止行号:", , 26)
h = InputBox("请输入要插入行数:", , 2)
For i = end To start Step -1
Rows(i + 1 & ":" & i + 1).Select
For j = 1 To h
Selection.Insert Shift:=xlDown
Next
Next
End Sub
张志晨
Sub charuhang()
j = 2 '即插入1行,若插入两行,则j=2....
For i = 3 To 26
Rows(30 - i & ":" & 30 - i).Select
For k = 1 To j
Selection.Insert Shift:=xlDown
Next k
Next i
End Sub