View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.misc
TomHinkle
 
Posts: n/a
Default For Next Infinite Loop

done EVER use Selection as the range for a loop.
Selection is directly tied to the interface, and in fact when you say
..activate, you change the selection and the way the loop will work.

Better to specify which cells you want to cycle through..

Try
For each rCell in Range("A1:A200")



"Naji" wrote:

I am getting an infinite loop when I run this code and today's date
isn't found. I'd like it to do nothing if it's not found. How would I
do that ?

For Each rCell In Selection
If rCell.Value = Date Then Range(rCell.Address).Offset(1, 0).Activate




Next rCell