View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Chip Pearson Chip Pearson is offline
external usenet poster
 
Posts: 7,247
Default RANGE & NESTED LOOPS

Jay,

1) Under most circumstances, mycell will refer to a single cell.
To be sure use
For Each mycell In SomeRange.Cells

2) Indentation is the easiest way to tell what code is in what
loop.

3) There is no difference. Value is the default property of
Range, so you may leave off the .Value if you so desire. I
usually include it for clarity.


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com


"jay dean" wrote in message
...
I have three questions ----

(1)Does the range mycell after the "Each" in
For Each mycell in SomeRange
always have to refer to one cell at a time in SomeRange?
If not, if I wanted mycell to refer to a range consisting of

multiple
cells in SomeRange, how do I do that?

(2)In general, when dealing with nested looping constructs how

do I
determine which loop is the inner loop and which is the outer?

I
sometimes have a problem with picturing how to construct nested
loops.Any tips or aids or recommendations which would assist me

picture
and easily construct nested loops would be appreciated.

(3) Lastly, what's the difference between
myrange=0 and myrange.value=0

Thanks.
Jay Dean

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!