LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 553
Default Type Mismatch: array or user defined type expected

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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Array problem: Key words-Variant Array, single-element, type mismatch error davidm Excel Programming 1 November 8th 05 04:21 AM
Help: Compile error: type mismatch: array or user defined type expected lvcha.gouqizi Excel Programming 1 October 31st 05 08:20 PM
Passing User Defined Type Array to Listbox PC[_4_] Excel Programming 2 June 1st 05 02:44 AM
User-defined data type; Error: Only User-defined types... tiger_PRM Excel Programming 1 July 18th 04 03:32 PM
Passing an Array of User-Defined Type to an Argument of a Function Tushar Mehta[_6_] Excel Programming 0 August 17th 03 06:43 PM


All times are GMT +1. The time now is 09:41 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"