Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 154
Default RANGE & NESTED LOOPS

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!
  #2   Report Post  
Posted to microsoft.public.excel.programming
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!



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Nested if using range names DianeG Excel Worksheet Functions 1 July 22nd 08 06:06 PM
Help with nested for loops [email protected] Excel Discussion (Misc queries) 5 May 2nd 07 05:30 PM
Help with nested for loops [email protected] Excel Worksheet Functions 5 May 2nd 07 05:30 PM
Max limit of 7 nested loops Subu Excel Worksheet Functions 2 May 28th 05 02:14 PM
Non Contiguous range and loops David Excel Programming 3 November 3rd 03 01:40 PM


All times are GMT +1. The time now is 02:25 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"