View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Frank Rizzo Frank Rizzo is offline
external usenet poster
 
Posts: 6
Default Looping through range newbie question

Sorry, for what maybe a really simple question - i am a newbie.

I've found that I can loop through a range via the following statement:

For Each c In MyRange.Cells
Debug.Print c.Value
Next

However, I need to know when the next row starts, so I am looking to
loop using the following construct:

For Each oRow In MyRange.Rows
For Each oCol In MyRange.Columns(oRow.index)
Debug.Print oCol.Cell.Value
Next
Next

But I can't figure out how to make it work. Is this possible? Or maybe
I am taking the wrong approach?

Thanks