View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Brian Brian is offline
external usenet poster
 
Posts: 683
Default Passing arrays through procedures

All,

I'm getting a compile error: Type mismatch: array or user-defined type
expected on the "Call Sort(arrDate)" line. What should I be looking for to
troubleshoot this? Below are the lines of code that deal with arrDate.

Sub Button17_Click()
ReDim arrDate(0)
Call GetMonths(arrDate,arrSite)
Call SiteSelected(arrDate,arrSite)
End Sub

Sub GetMonths(arrDate, arrSite as Variant)
'Here is where I build arrDate and send to Sort to get them in order
Call Sort(arrDate)
End Sub

Sub Sort(arr() as Variant)
'Sort array in order
End Sub

Sub SiteSelected(arrDate,arrSite as Variant)
'Here arrDate is actually used
End Sub

I know my arrDate array gets built properly because it appears correctly in
the SiteSelected Procedure when I skip the Sort Procedure. Clearly I don't
know how to pass arrays through procedures effectively so any help with that
would be appreciated also.
--
Brian