Hi,
I have a problem. I'm fairly new to VBA and I can't figure out how to sort a multidimensional array by the first column. An example of how to move the whole row based on the first column would help. Thanks.
Brute force method (Bubble sort)
Dim arrVehicles(1 to 10398, 1 to 6)
For i=1 To 10398
For j=i+1 To 10398
If arrVehicles(i,1)>arrVehicles(j,1) Then
For k=1 To 6
tmp=arrVehicles(i,k)
arrVehicles(i,k)=arrVehicles(j,k)
arrVehicles(j,k)=tmp
Next k
End If
Next j
Next i
I left as an exercise the use of LBound and UBound
Hope This Help, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.