I created a user defined function. I'm trying to call it in my macro.
When the code reaches the line with my function, I get a Run-time error
'438': Object doesnt support this property or method?
Function SMM(incentivebeta As Double, agebeta As Double, intercept As Double, incentive As Double, age As Double) As Double
SMM = 1 / (1 + Exp(-(intercept + incentivebeta * incentive + agebeta * age)))
End Function
Private Sub btnSimulate_Click()
Dim counter As Long
For counter = 1 To 360
ws.Range("start").Offset(counter, 7).Value = WorksheetFunction.SMM(1, 2, 3, 4, 5)
SMM?