1
如何在MS Excel VBA中將數組作爲參數傳遞給用戶定義的函數?Excel:在用戶定義的函數中傳遞數組?
最後,我想測試,如果某一特定日期(dateDay)在日期的幾個範圍(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
然而,已經在這個階段,功能不能正常工作。它返回#VALUE!