That was a dumb post to make most any time and especially in the midst
of a heated argument. ParamArray X() cannot simply be passed on to
StDev. :( It results in a Type mismatch. Sorry. Nonetheless, that
error doesn't negate the concept I wanted to focus on, i.e., leveraging
the XL object model and letting it do as much "heavy lifting" as
possible.
--
Regards,
Tushar Mehta
www.tushar-mehta.com
Excel, PowerPoint, and VBA add-ins, tutorials
Custom MS Office productivity solutions
In article ,
hEm says...
Yes, VBA can play a significant role in developing cleaner workbooks.
Whether it helps in a case of replacing 2 simple functions with one UDF
is debatable. Nonetheless, if you do want to do down this road, you
can still leverage the XL object model. Untested code:
Public Function RSD(ParamArray X() As Variant)
With Application.WorksheetFunction
RSD = .StDev(X) / .Average(X) * 100
End With
End Function