简体   繁体   English

Excel VBA试图在单元格A2:E2中插入空白行

[英]Excel VBA trying to insert a blank row in cells A2:E2

I am trying to insert a blank row in cells A2:E2 我正在尝试在单元格A2:E2中插入空白行

I currently am inserting an entire blank row using "Rows(2).Insert shift:=xlShiftDown" but ideally I would only like to insert a new row in row 2 from columns A to E 我目前正在使用“ Rows(2).Insert shift:= xlShiftDown”插入整个空白行,但理想情况下,我只想在第2行中从A到E列插入新行

This should work: 这应该工作:

Sub insertRow()

    Range("A2:E2").Insert Shift:=xlShiftDown

End Sub

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM