ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   inserting Rows (https://www.excelbanter.com/excel-programming/364851-inserting-rows.html)

Taru[_17_]

inserting Rows
 

What are some commands to insert a row with VBA

--
Tar
-----------------------------------------------------------------------
Taru's Profile: http://www.excelforum.com/member.php...fo&userid=3549
View this thread: http://www.excelforum.com/showthread.php?threadid=55368


Bearacade[_16_]

inserting Rows
 

Try these:

Rows("1:1").Select
Selection.Insert Shift:=xlDown

or

Selection.EntireRow.Insert

HTH


--
Bearacade


------------------------------------------------------------------------
Bearacade's Profile: http://www.excelforum.com/member.php...o&userid=35016
View this thread: http://www.excelforum.com/showthread...hreadid=553684


Jim Thomlinson

inserting Rows
 
You anc take any range and expand it to encompass the entire row and then
just insert. here are a few examples...

Sub TestInsert()
Dim rng As Range

Set rng = Range("A2")
rng.EntireRow.Insert

Range("A4:C6").EntireRow.Insert

Range("9:9").Insert
End Sub
--
HTH...

Jim Thomlinson


"Taru" wrote:


What are some commands to insert a row with VBA?


--
Taru
------------------------------------------------------------------------
Taru's Profile: http://www.excelforum.com/member.php...o&userid=35494
View this thread: http://www.excelforum.com/showthread...hreadid=553684



Die_Another_Day

inserting Rows
 
if that wasn't enough try this...
Rows("1:10").Insert

Die_Another_Day
Jim Thomlinson wrote:
You anc take any range and expand it to encompass the entire row and then
just insert. here are a few examples...

Sub TestInsert()
Dim rng As Range

Set rng = Range("A2")
rng.EntireRow.Insert

Range("A4:C6").EntireRow.Insert

Range("9:9").Insert
End Sub
--
HTH...

Jim Thomlinson


"Taru" wrote:


What are some commands to insert a row with VBA?


--
Taru
------------------------------------------------------------------------
Taru's Profile: http://www.excelforum.com/member.php...o&userid=35494
View this thread: http://www.excelforum.com/showthread...hreadid=553684





All times are GMT +1. The time now is 06:44 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com