UBound seems to not be returning anything. I am using the Pricer function in excel and passing it a column. Did I mismatch my data types? I UBound on a dummy array that accessed arrP.Value and that didnt work either. Thoughts?
Function Pricer(arrP As Variant) As Double
sd = Application.WorksheetFunction.StDevP(arrP)
avg = Application.WorksheetFunction.Average(arrP)
PriceUB = avg + sd
PriceLB = avg - sd
MsgBox UBound(aarP)
Pricer = Application.WorksheetFunction.Average(arrP)
End Function
Range.Value
is 2 dimensional. – CominternMsgBox UBound(aarP)
theaarP
should bearrP
. Otherwise, it should work fine. – GeneOption Explicit
at the very top of your vba code – Marcucciboy2