+ Reply to Thread
Results 1 to 3 of 3

Subscript out of range error using all possible combinations code

  1. #1
    Registered User
    Join Date
    05-05-2010
    Location
    London
    MS-Off Ver
    Excel 2007
    Posts
    2

    Subscript out of range error using all possible combinations code

    I have this code:
    Please Login or Register  to view this content.

    And it works fine through the first 5 iterations of the i+1 loop, but when it comes to "Next C" I get an error that says subscript out of range. Any ideas why this may be happening?

    Any help would be greatly appreciated.
    Cheers,
    Ali
    Last edited by alisalamiii; 05-05-2010 at 11:59 AM.

  2. #2
    Forum Expert MickG's Avatar
    Join Date
    11-23-2007
    Location
    Banbury,Oxfordshire
    Posts
    2,650

    Re: Subscript out of range error using all possible combinations code

    Hi, All your named arrays have 5 Elements ,but your loops Have 6.Loops
    This array :- Track = Array("a", "b", "c", "d", "e") & similar Have 5 Elements.
    Loops:- " For t = 0 To 5" and similar Have 6 loops.
    Add an elements to each array or shorten each loop.By 1
    Regards Mick

  3. #3
    Registered User
    Join Date
    05-05-2010
    Location
    London
    MS-Off Ver
    Excel 2007
    Posts
    2

    Re: Subscript out of range error using all possible combinations code

    Thank you very much, works like a charm I knew it was something simple, just couldn't see it!

    Cheers for your help!

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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