Consulting | Excel Examples
Keywords: Sort, Timer, Random Number
Description: Comparison of the time required to sort a Visual Basic for Applications Array using three methods.
Tip: You can sort an array by transferring it to the worksheet and using Excel's built in sort. Another sorting method is the Visual Basic for Applications "Bubble Sort". Quick Sort, adapted from the "Visual Basic Developers Guide" By D.F. Scott, is a third method. You can create a test array with random values and use the Timer method to compare the time required to perform the sort using each of the three methods
Guide to the Example: Click on the "Sort an Array Using Three Different Techniques" button on Sheet1. Enter the size of the array you want to test. A message box will display the three times.
Download File: Click Here
Tip: Click on the link above and choose "Save" to download the xls workbook to your hard drive or "Open" to open the workbook inside of your browser.