Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I have an array that I am trying to sort. I keep getting an this compile
error: "Type Mismatch: array or user defined type expected " on the line Call Sort(NumberOfRuns - 1, EBITDAArray). It highlights the EBITDAArray. Why is this? Thanks Sub Main () Dim EBITDAArray as Variant Dim X as Double Dim NumberOfRuns as Double For X = NumberOfRuns - 1 'Populate Array with code Next Call Sort(NumberOfRuns - 1, EBITDAArray) End Sub Sub Sort(n As Double, arr() As Variant) Dim Temp As Double Dim i As Long Dim j As Long For j = 2 To n Temp = arr(j) For i = j - 1 To 1 Step -1 If (arr(i) <= Temp) Then GoTo 10 arr(i + 1) = arr(i) Next i i = 0 10 arr(i + 1) = Temp Next j End Sub |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Array problem: Key words-Variant Array, single-element, type mismatch error | Excel Programming | |||
Help: Compile error: type mismatch: array or user defined type expected | Excel Programming | |||
Passing User Defined Type Array to Listbox | Excel Programming | |||
User-defined data type; Error: Only User-defined types... | Excel Programming | |||
Passing an Array of User-Defined Type to an Argument of a Function | Excel Programming |