+ Reply to Thread
Results 1 to 2 of 2

Help reading For loop with range variable

  1. #1
    Registered User
    Join Date
    03-17-2014
    Location
    Canada
    MS-Off Ver
    Office 365
    Posts
    12

    Help reading For loop with range variable

    Hi Guys,

    I'm trying to understand a code from work and I can't get it. I copied only a part of the code here so please don't run it. Also, I have manual inputs in columns L and M (nodes labels such as 1, 2 and 2,3) and section labels on column N (such as BarFT3, BarFT4 etc):

    Please Login or Register  to view this content.
    What is this loop doing? I just get the first For loop: goes through every lable on colum N (from 1 to ne) but then what?
    What is happening to range nudo(n,j)? How works this ">" sign between nudo(n.j) and nn?

    Thanks guys

  2. #2
    Forum Expert
    Join Date
    08-02-2013
    Location
    Québec
    MS-Off Ver
    Excel 2003, 2007, 2013
    Posts
    1,414

    Re: Help reading For loop with range variable

    My understanding is that this code finds the greatest values in the range nudo.
    You loop in rows (for n = 1 to ne) and columns (j = 1 to 2).
    You look at the value of each cells in the nudo range and if it is greater then nn then nn gets the value of that cell nudo(n, j)

    One simpler way to do it would be :
    Please Login or Register  to view this content.
    GC Excel

    If this post helps, then click the star icon (*) in the bottom left-hand corner of my post to Add reputation.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Do Loop with variable range
    By Austex_egger in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 08-08-2013, 03:08 PM
  2. Do Loop with Variable Range
    By Austex_egger in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 07-24-2013, 03:52 PM
  3. Why did an inner loop variable start overwriting the outer loop range suddenly?
    By 111StepsAhead in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 05-16-2012, 03:24 PM
  4. [SOLVED] Referencing variable Range in a loop
    By Samirkc in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-14-2006, 07:55 AM
  5. [SOLVED] How to reference variable range in a loop
    By Samirkc in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 07-13-2006, 11:15 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1