ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   deleting rows (https://www.excelbanter.com/excel-programming/304974-deleting-rows.html)

eric

deleting rows
 
Hello

I have a macro which searches row by row for trigger
values which mark the beginning and end of rows to be
deleted.

I can delete these rows one at a time, but would deleting
them at all at one time be better, and if so what would
the code be?



Ron de Bruin

deleting rows
 
Hi Eric

Start here
http://www.rondebruin.nl/delete.htm
And post back if you need help


--
Regards Ron de Bruin
http://www.rondebruin.nl


"Eric" wrote in message ...
Hello

I have a macro which searches row by row for trigger
values which mark the beginning and end of rows to be
deleted.

I can delete these rows one at a time, but would deleting
them at all at one time be better, and if so what would
the code be?





Bob Phillips[_6_]

deleting rows
 
Eric,

Here is a technique using Autofilter

http://www.xldynamic.com/source/xld.Deletingv3.html
Deleting Rows/Columns in VBA - Autofilter

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"Eric" wrote in message
...
Hello

I have a macro which searches row by row for trigger
values which mark the beginning and end of rows to be
deleted.

I can delete these rows one at a time, but would deleting
them at all at one time be better, and if so what would
the code be?





Stan Scott

deleting rows
 
Eric,

As your macro searches for the ranges, give each one a range name, such as
"rng1", "rng2", and "rng3". Then, this code will delete all of the rows at
once:

Application.Union(Range("rng1"), Range("rng2"),
Range("rng3")).EntireRow.Delete

Delete the temporary range names, and you're done.

Stan Scott
New York City


"Eric" wrote in message
...
Hello

I have a macro which searches row by row for trigger
values which mark the beginning and end of rows to be
deleted.

I can delete these rows one at a time, but would deleting
them at all at one time be better, and if so what would
the code be?






All times are GMT +1. The time now is 02:55 AM.

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