ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Inserting multiple rows... (https://www.excelbanter.com/excel-programming/400341-inserting-multiple-rows.html)

Sonnich Jensen[_2_]

Inserting multiple rows...
 
How do I insert multiple rows at once?

Like

ws.Rows(j + 1).Insert i - 1

this adds one row, I need i-1 rows

I cannot find it in the help, or do I need a for loop?

WBR
Sonnich


JE McGimpsey

Inserting multiple rows...
 
One way:

ws.Rows(j + 1).Resize(i - 1).Insert

In article . com,
Sonnich Jensen wrote:

How do I insert multiple rows at once?

Like

ws.Rows(j + 1).Insert i - 1

this adds one row, I need i-1 rows

I cannot find it in the help, or do I need a for loop?

WBR
Sonnich



All times are GMT +1. The time now is 09:00 AM.

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