Arrays can be passed to proceedures by putting () after the name of the array variable.
Function countElements(ByRef arr() As Double) As Long
countElements = UBound(arr) - LBound(arr) + 1
End Function
Arrays must be passed by reference. If no passing mechanism is specified, e.g. myFunction...