File tree Expand file tree Collapse file tree 2 files changed +2
-2
lines changed
Editing Excel cells/Sort On Cell Values/.NET/Sort On Cell Values/Sort On Cell Values Expand file tree Collapse file tree 2 files changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -20,7 +20,7 @@ static void Main(string[] args)
2020 IDataSort sorter = workbook . CreateDataSorter ( ) ;
2121
2222 //Range to sort
23- sorter . SortRange = worksheet . UsedRange ;
23+ sorter . SortRange = worksheet . Range [ "A1:B11" ] ;
2424
2525 //Adds a sort field: sort by values in column A in ascending order
2626 sorter . SortFields . Add ( 0 , SortOn . Values , OrderBy . Ascending ) ;
@@ -35,7 +35,7 @@ static void Main(string[] args)
3535 sorter = workbook . CreateDataSorter ( ) ;
3636
3737 //Range to sort
38- sorter . SortRange = worksheet . UsedRange ;
38+ sorter . SortRange = worksheet . Range [ "C1:C11" ] ;
3939
4040 //Adds a sort field: sort by values in column C in descending order
4141 sorter . SortFields . Add ( 2 , SortOn . Values , OrderBy . Descending ) ;
You can’t perform that action at this time.
0 commit comments