+ Reply to Thread
Results 1 to 4 of 4

Invalid next control variable reference?

  1. #1
    Forum Contributor
    Join Date
    04-04-2014
    Location
    Tetbury, England
    MS-Off Ver
    Excel 2010
    Posts
    254

    Invalid next control variable reference?

    Could someone explain why this doesn't work?

    I get the error message: Invalid Next control variable reference
    And it highlights the i in 'Next i'


    Please Login or Register  to view this content.

  2. #2
    Forum Expert
    Join Date
    04-22-2013
    Location
    .
    MS-Off Ver
    .
    Posts
    4,418

    Re: Invalid next control variable reference?

    You initialise 3 for loops, but only provide next statements for two of them:
    Please Login or Register  to view this content.

  3. #3
    Valued Forum Contributor Miroslav R.'s Avatar
    Join Date
    05-16-2013
    Location
    NMnV, Slovakia
    MS-Off Ver
    Excel 2007
    Posts
    479

    Re: Invalid next control variable reference?

    Hi,
    I am missing 'Next r' in your preview.

    Regards

    M

  4. #4
    Registered User
    Join Date
    06-25-2013
    Location
    San Diego, CA
    MS-Off Ver
    Excel 2010
    Posts
    51

    Re: Invalid next control variable reference?

    Also, just a suggestion, you use indenting, but you didn't indent the For r line. You should be able to line up your For lines with the corresponding Next lines.

+ 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. invalid next control variable reference
    By stockgoblin42 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 09-03-2013, 05:08 PM
  2. invalid next control variable reference for looping
    By alienalvan in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 05-30-2013, 03:19 PM
  3. [SOLVED] Invalid Next control variable reference
    By dslack in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 06-05-2012, 08:20 PM
  4. invalid next control variable reference
    By stevesunfold in forum Excel Programming / VBA / Macros
    Replies: 13
    Last Post: 05-17-2008, 08:09 PM
  5. Invalid Next Control Variable Reference
    By teresa in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 05-31-2005, 08:05 PM

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