VBA 中可以使用简单的冒泡排序算法对二维数组中的多列进行排序。下面是一个例子:
SubSortArray(arr As Variant, col As Long)
Dim i As Long, j As Long, temp As Variant
For i = LBound(arr, 1) To UBound(arr, 1)
For j = i + 1 To UBound(arr, 1)
If arr(i, col) > arr(j, col) Then
temp = arr(i, col)