I got the QuickSort code from somewhere??
here is a quick example.

VB Code:
  1. Private Type Descriptions
  2.     strDesc As String
  3.     strCode As String
  4. End Type
  5.  
  6. Private Sub Quicksort(ByRef p_Array() As Descriptions, ByVal inLow As Long, ByVal inHi As Long)
  7. 'A version of the QuickSort Algorithm applied to the User Defined Data Type "Descriptions"
  8.    Dim pivot   As Descriptions
  9.    Dim tmpSwap As Descriptions
  10.    Dim tmpLow  As Long
  11.    Dim tmpHi   As Long
  12.    
  13.    tmpLow = inLow
  14.    tmpHi = inHi
  15.    
  16.    pivot = p_Array((inLow + inHi) \ 2)
  17.  
  18.    While (tmpLow <= tmpHi)
  19.  
  20.       While (p_Array(tmpLow).strDesc < pivot.strDesc And tmpLow < inHi)
  21.          tmpLow = tmpLow + 1
  22.       Wend
  23.      
  24.       While (pivot.strDesc < p_Array(tmpHi).strDesc And tmpHi > inLow)
  25.          tmpHi = tmpHi - 1
  26.       Wend
  27.  
  28.       If (tmpLow <= tmpHi) Then
  29.          tmpSwap = p_Array(tmpLow)
  30.          p_Array(tmpLow) = p_Array(tmpHi)
  31.          p_Array(tmpHi) = tmpSwap
  32.          tmpLow = tmpLow + 1
  33.          tmpHi = tmpHi - 1
  34.       End If
  35.    
  36.    Wend
  37.  
  38.    If (inLow < tmpHi) Then Quicksort p_Array, inLow, tmpHi
  39.    If (tmpLow < inHi) Then Quicksort p_Array, tmpLow, inHi
  40.  
  41. End Sub