View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
Bob Flanagan Bob Flanagan is offline
external usenet poster
 
Posts: 340
Default Stepping through For Each...Next backwards?

Step through it one time, assigning the values to an array. Then step
through the array backwards.

Bob Flanagan
Macro Systems
http://www.add-ins.com
Productivity add-ins and downloadable books on VB macros for Excel

"Mike Lee" wrote in message
...
Hello,
Is there a way to use a For Each...Next loop but have VBA
step through the collection from the last element to the
first? I'm trying to step through a range and delete
rows that don't meet certain criteria, and I need to work
from the bottom up. I know I can do it by counting the
rows in the range and using:

for i = lastrow to 1 step -1

But I figured it'd be less lines of code if something
existed like this:

for each cl in rng step backwards

Not a big deal if it doesn't, but figured it was worth
asking.

Thanks to all.

Mike