In This Topic
Sorts a range of cells in this sheet in the data model.
Syntax
'Declaration
Public Function SortRange( _
ByVal As Integer, _
ByVal column As Integer, _
ByVal As Integer, _
ByVal columnCount As Integer, _
ByVal As Boolean, _
ByVal () As SortInfo _
) As Boolean
'Usage
Dim instance As Worksheet
Dim row As Integer
Dim column As Integer
Dim rowCount As Integer
Dim columnCount As Integer
Dim byRows As Boolean
Dim sortInfo() As SortInfo
Dim value As Boolean
value = instance.SortRange(row, column, rowCount, columnCount, byRows, sortInfo)
Parameters
- row
- The index of the starting row of the block of cells to sort.
- column
- The index of the starting column of the block of cells to sort.
- rowCount
- The number of rows in the block of cells.
- columnCount
- The number of columns in the block of cells.
- byRows
- Set to
true
to sort by rows; false to sort by columns. - sortInfo
- The SortInfo object with sort criteria and information about how to perform the sort.
Return Value
true
if the data is successfully sorted; otherwise, false
.
Example
This example uses the SortRange method.
See Also