'======================================== Sub Gen_SortArray(aInput) 'This function sorts an array using the .NET System.Collections.ArrayList 'Usage: 'Call Gen_SortArray(aRows) 'Where aRows is a simple one-dimensional array containing data Dim oList, sItem, iIndex Set oList = CreateObject("System.Collections.ArrayList") 'Load the object For iIndex = lBound(aInput) to uBound(aInput) oList.Add aInput(iIndex) Next 'Sort it oList.Sort() 'Get the data back iIndex = lBound(aInput) For Each sItem In oList aInput(iIndex) = sItem iIndex = iIndex + 1 Next Set oList = Nothing End Sub '========================================