Something like this:
Private Sub Sort2DArray(ByVal TwoD\_Arr(,) As Double)
'
Dim Tmp\_Arr(0, 1) As Double
Dim upperInd As Integer
Dim lowerInd As Integer
'
For upperInd = 0 To TwoD\_Arr.GetLength(0) - 1
'
For lowerInd = (upperInd + 1) To TwoD\_Arr.GetLength(0) - 1
'
If (TwoD\_Arr(lowerInd, 0) > TwoD\_Arr(upperInd, 0)) Then
'
Tmp\_Arr(0, 0) = TwoD\_Arr(lowerInd, 0)
Tmp\_Arr(0, 1) = TwoD\_Arr(lowerInd, 1)
'
TwoD\_Arr(lowerInd, 0) = TwoD\_Arr(upperInd, 0)
TwoD\_Arr(lowerInd, 1) = TwoD\_Arr(upperInd, 1)
'
TwoD\_Arr(upperInd, 0) = Tmp\_Arr(0, 0)
TwoD\_Arr(upperInd, 1) = Tmp\_Arr(0, 1)
End If
'
Next
'
Next
'
End Sub
Private Sub Button1\_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim TwoD\_Arr(,) As Double = {{5, 1}, {6, 2}, {3, 3}, {8, 4}, {2, 5}}
Dim i As Integer
Dim j As Integer
For i = 0 To TwoD\_Arr.GetLength(0) - 1
Debug.WriteLine("UnSorted: " & TwoD\_Arr(i, 0) & " " & TwoD\_Arr(i, 1))
Next
Sort2DArray(TwoD\_Arr)
For j = 0 To TwoD\_Arr.GetLength(0) - 1
Debug.WriteLine("Sorted: " & TwoD\_Arr(j, 0) & " " & TwoD\_Arr(j, 1))
Next
End Sub
Returns: UnSorted: 5 1 UnSorted: 6 2 UnSorted: 3 3 UnSorted: 8 4 UnSorted: 2 5 Sorted: 8 4 Sorted: 6 2 Sorted: 5 1 Sorted: 3 3 Sorted: 2 5 Hope that helps, progload