Do you mean you want to sort on say, column 2 with column 4 as a sub-sort? A bit like in Excel where it says 'Sort on column A... then Column B...' and so on?
If so, then MSFlexGrid doesn't do that but you could do it programatically. I would do the following:
1. Create a hidden listbox somewhere off-screen and set it to Sorted=True
2. Go through your grid one row at a time. The aim is to create a string which contains the following:
{Data from first column you want to sort on}
{chr$(1)}
{Data from second column you want to sort on}
{chr$(2)}
{Data from column 1}
{chr$(1)}
{Data from column 2}
{chr$(1)}
{Data from column 3} etc...
Add the string to the list and move on to the next row. Wash, rinse, repeat until all rows have been added.
3. Repopulate the grid using the data from the list. Take each list item and find the chr$(2) character within the data:
a& = instr(List1.list(b&), chr$(2))
Take everything after the a&th character and add it into each column, using chr$(1) as a delimiter, ignoring everything before the a&th character (that was just used to sort it correctly).
- Andy.