+ Reply to Thread
Results 1 to 8 of 8

Help needed with a sorting procedure on an array - Subscript out of range

  1. #1
    Forum Contributor
    Join Date
    04-07-2013
    Location
    France
    MS-Off Ver
    Excel 2011
    Posts
    166

    Help needed with a sorting procedure on an array - Subscript out of range

    I am working on the following code, which is supposed to get the values from a spreadsheet into arrays, sort them (it's a triple sort here - three arrays are sorted at once), and finally place the results in another sheet...

    The problem is I get a Subscript out of range" error message and I really don't know how to fix it
    I seem to have this problem EACH time I try sorting an array.. so there must be something wrong with the Sort ... (it is called TriFonds here)

    Any help will be greatly appreciated..

    Please Login or Register  to view this content.
    Attached Files Attached Files

  2. #2
    Forum Contributor
    Join Date
    04-07-2013
    Location
    France
    MS-Off Ver
    Excel 2011
    Posts
    166

    Re: Help needed with a sorting procedure on an array - Subscript out of range

    I updated the code.. now it returns a type mismatch error.. before it gave zeros everywhere

    Please Login or Register  to view this content.
    Last edited by seigna; 05-06-2013 at 08:06 AM.

  3. #3
    Forum Contributor
    Join Date
    04-07-2013
    Location
    France
    MS-Off Ver
    Excel 2011
    Posts
    166

    Re: Help needed with a sorting procedure on an array - Subscript out of range

    I have updated the worksheet with the code..
    Attached Files Attached Files

  4. #4
    Forum Contributor
    Join Date
    04-07-2013
    Location
    France
    MS-Off Ver
    Excel 2011
    Posts
    166

    Re: Help needed with a sorting procedure on an array - Subscript out of range

    Anyone a clue ? Im getting desperate with this, I changed the code so many times :'( :'(

  5. #5
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,645

    Re: Help needed with a sorting procedure on an array - Subscript out of range

    The type mismatch is because one of the columns you are dealing with is full of strings.

    Actually I would suggest you declare the various arrays as Variant.

    By the way, why aren't you using Excel's built-in sort?
    If posting code please use code tags, see here.

  6. #6
    Forum Contributor
    Join Date
    04-07-2013
    Location
    France
    MS-Off Ver
    Excel 2011
    Posts
    166

    Re: Help needed with a sorting procedure on an array - Subscript out of range

    I could have but the project I am working on requires to type up my own code... but if worst comes to worst I'll just do that..

    And I did change the arrays to Variant but it didn't help - It came back to subscript out of Range error :'(

  7. #7
    Forum Contributor
    Join Date
    04-07-2013
    Location
    France
    MS-Off Ver
    Excel 2011
    Posts
    166

    Re: Help needed with a sorting procedure on an array - Subscript out of range

    I've gotten this far.. and now I have no clue what next ... :/
    Attached Files Attached Files

  8. #8
    Forum Contributor
    Join Date
    04-07-2013
    Location
    France
    MS-Off Ver
    Excel 2011
    Posts
    166

    Re: Help needed with a sorting procedure on an array - Subscript out of range

    I'm going to try the excel sort.. this is just strange..

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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