简体   繁体   中英

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

I am trying to insert a blank row in cells 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

This should work:

Sub insertRow()

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

End Sub

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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