up) Then
         lIndex = i
      End If
   Next i
   GetLastGroupSortColumn = lIndex
End Function

Friend Function FindInsertLocation( _
        ByRef vItems() As tGridCell, _
        ByRef tRows() As tRowPosition, _
        ByVal lStartItem As Long, _
        ByVal lItems As Long, _
        ByRef iResult As Long _
      ) As Long
Dim iStartRow As Long
Dim iEndRow As Long
Dim iMidRow As Long
Dim lRow As Long
Dim bGroupRowsOnly As Boolean
Dim bRemoveTempSort As Boolean
Dim lIndentMatchLevel As Long
Dim lIn