I am very fresh with Excel VBA, so I ask you for understanding. Doing research on the internet has not resolved my problem. So I wish to pass an array of numerical values in VBA into a function, namely enter cash flows into an NPV function all in Excel VBA code.
Dim Postavke() As String, velikost As Integer, i As Integer
velikost = WorksheetFunction.CountA(Worksheets("List1").Columns(11))
ReDim Postavke(velikost)
For i = 1 To velikost
Postavke(i) = Cells(i + 1, 11).Value
Next i
Now I want to pass the Postavke() array to the NPV function:
Dim NSV As Long
NSV = NPV(0.06, ByRef Postavke() As Long))
which always goes an error. Any thoughts to how this might be done?
Thank you in advance. Best regards.
Postavkeas aStringarray.