Hello,
I've created a custom VBA function that returns the square root of a number plus 10. Here's my function:
I’d like to understand more about how UDFs work. Here are my questions:
I've created a custom VBA function that returns the square root of a number plus 10. Here's my function:
Code:
Function RootPlusTen(x As Double) As Double
RootPlusTen = Sqr(x) + 10
End Function
I’d like to understand more about how UDFs work. Here are my questions:
- Why do we use Function instead of Sub when creating a custom formula?
- How can I modify this function so it returns an error message if the input is text or empty?
- Is it possible for this function to call another macro or function inside it?