+ Reply to Thread
Results 1 to 3 of 3

VBA sorting by multiple criteria help needed

Hybrid View

motorhead9999 VBA sorting by multiple... 11-14-2012, 06:03 PM
AlphaFrog Re: VBA sorting by multiple... 11-14-2012, 07:21 PM
motorhead9999 Re: VBA sorting by multiple... 11-14-2012, 07:24 PM
  1. #1
    Registered User
    Join Date
    10-18-2012
    Location
    Florida
    MS-Off Ver
    Excel 2010
    Posts
    13

    VBA sorting by multiple criteria help needed

    VBA in Excel, Office 2010

    So my creation algorithm creates an array of objects of possible combinations, copies the values to an excel spreadsheet, sorts the spreadsheet by 8 different criteria, then outputs the ordered list to a listbox for the user to select. The user selects which item they want, and then moves on.

    Unfortunately (and I have noone to blame for this but myself) I used a lot of cheap shortcuts like that to quicken the coding process. Now that there's some talk of moving my application from out of excel, I've been trying to streamline/optimize my code so that when I go to another language, the coding will be fairly similar in whatever language it gets written in.

    My program works currently because I have the crutch of the excel spreadsheet to re-select my data once selection occurs. I would like to rewrite my code so that the sorting is done within the actual object array, so that when the user selects something on the listbox, I can just use the index selected from the listbox to then choose the correct object to move on, without using any inbuilt excel functions. All the items I have to sort would be done by either numerical or alphabetical.

  2. #2
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,653

    Re: VBA sorting by multiple criteria help needed

    You may find Chip Pearson's Sorting Array In VBA article helpful.

    Also consider that the application or Code Language you port to may have better built-in array sorting tools than VBA offers.

  3. #3
    Registered User
    Join Date
    10-18-2012
    Location
    Florida
    MS-Off Ver
    Excel 2010
    Posts
    13

    Re: VBA sorting by multiple criteria help needed

    Thanks! This is what I needed.

+ 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