ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Deleting a group of rows (https://www.excelbanter.com/excel-programming/367741-deleting-group-rows.html)

dan

Deleting a group of rows
 
Is it possible to use the Rows property to delete a range of rows in one
statement in a macro, or must I use a loop and .Rows(I).Delete for each row
one at a time?

Dan

excelent

Deleting a group of rows
 
Range("M14:O14").EntireColumn.Delete



"Dan" skrev:

Is it possible to use the Rows property to delete a range of rows in one
statement in a macro, or must I use a loop and .Rows(I).Delete for each row
one at a time?

Dan


Paul Lautman

Deleting a group of rows
 
excelent wrote:
Range("M14:O14").EntireColumn.Delete


or even EntireRow



Jim Thomlinson

Deleting a group of rows
 
As a guess you intended rows not columns...

Range("M14:O14").EntireRow.Delete

Deleting is one of those slow things to do in Excel. You are always better
off to create one single large range area and delete it all at once than to
delete a bunch of rows one at a time. The rows do not have to be continuious
either

Range("A1:A5", "A10:A15").entirerow.delete



--
HTH...

Jim Thomlinson


"excelent" wrote:

Range("M14:O14").EntireColumn.Delete



"Dan" skrev:

Is it possible to use the Rows property to delete a range of rows in one
statement in a macro, or must I use a loop and .Rows(I).Delete for each row
one at a time?

Dan


Don Guillett

Deleting a group of rows
 
do you mean this?

Sub delrows()
Rows("17:19").Delete
'or
'Rows(17).Resize(3).Delete
End Sub

--
Don Guillett
SalesAid Software

"Dan" wrote in message
...
Is it possible to use the Rows property to delete a range of rows in one
statement in a macro, or must I use a loop and .Rows(I).Delete for each
row
one at a time?

Dan





All times are GMT +1. The time now is 12:05 PM.

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