Dermot
Board Regular
- Joined
- Aug 11, 2006
- Messages
- 199
- Office Version
- 365
- Platform
- Windows
Dermot submitted a new Excel article:
VBA: Enhance and speed up random numbers and sorting, using spill functions - VBA: Enhance and speed up random numbers and sorting, using spill functions
Read more about this Excel article...
VBA: Enhance and speed up random numbers and sorting, using spill functions - VBA: Enhance and speed up random numbers and sorting, using spill functions
Sorting Arrays
VBA does not have a built in sort function, which requires having your own sorting code. But now, the Excel Sort function can be used in VBA, and based on my testing, it is faster than my quicksort function.
Note that the array must be 2D, eg (1000,1) or (500,3)
For example if you have an array A, you can sort it into an array B like this
you can include a sort column and sort direction if needed, just as in...VBA Code:B = Application.WorksheetFunction.Sort(A)
Read more about this Excel article...