I am reading data from file to array with For Next loop. I get the data to array but when I try to pass this unsorted array to bubblesort function I get type mismatch error. I don't understand why.
'This causes type mismatch
arrTestArray = BubbleSort(arrTestArray)
Function BubbleSort(arrValues)Dim j, k, Temp
For j = 0 To UBound(arrValues) - 1
For k = j + 1 To UBound(arrValues)
If (arrValues(j) > arrValues(k)) Then
Temp = arrValues(j)
arrValues(j) = arrValues(k)
arrValues(k) = Temp
End If
Next
Next
BubbleSort = arrValues
End Function