How to pass an array as a parameter for a user defined function in MS Excel VBA?
Eventually I want to test that if a given date (dateDay) is in several ranges of dates (arrayVacation):
Function CB_IsInRangeArr(dateDay As Date, ParamArray arrayVacation() As Variant) As Boolean
' Test that the array is in the form of 2 columns and n rows / if not send back an error
If (UBound(arrayVacation, 1) <> 2) Then
CB_IsInRangeArr = CVErr(xlErrNA)
Else
CB_IsInRangeArr = TRUE
End If
End Function
Yet already at this stage, the function does not work properly. It returns #VALUE! and I can find a way to get it to work.
Thank you for your help,