View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Mike Lee[_2_] Mike Lee[_2_] is offline
external usenet poster
 
Posts: 3
Default Stepping through For Each...Next backwards?

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