dexLastGroup As Long

   lIndexLastGroup = GetLastGroupSortColumn
   If (lIndexLastGroup = m_iSortIndexCount) And (m_iSortIndexCount &gt; 0) Then
      lIndentMatchLevel = lIndexLastGroup
      ' Temporarily Add row group indent level to the sort
      m_iSortIndexCount = m_iSortIndexCount + 1
      ReDim Preserve m_tSort(1 To m_iSortIndexCount) As tSortInfo
      m_tSort(m_iSortIndexCount).SortType = INTERNAL_FIND_GROUP_LEVEL
      bRemoveTempSort = True
   End If

   iStartRow = lStartItem
   iEndRow = lI