在excel-vba中,如何将参数数组传递给需要相同参数数组的函数?我环顾四周,但似乎找不到这个具体问题的任何答案
我的代码如下所示:
Sub test()
GetRefData "SPX Index", "PX_LAST", "PX_VOLUME", "PE_RATIO", "PX_TO_CASH_FLOW"
End Sub
Public Function GetRefData(security As String, ParamArray fields() As Variant) As String
Debug.Print fields(0) // returns "PX_LAST"
SendReq security, fields
End Function
Sub SendReq(security, ParamArray fields() As Variant)
Debug.Print fields(0) // returns type mismatch
End Subhttps://stackoverflow.com/questions/41562661
复制相似问题