deleting rows

  • Thread starter Thread starter Eric
  • Start date Start date
E

Eric

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?
 
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top