I am having a bit of trouble with the return function on VBA and was hoping someone would be able to help me troubleshoot the issue.
Here is the function:
Function Hypotenuse(side1 As Double, side2 As Double) As Double
Return Math.Sqrt((side1 ^ 2) + (side2 ^ 2))
End Function
Summary of the Issue:
- The return function is highlighted in 'red' and I am unable to run any sub-routine that calls the function (see attached picture)
- Pretty sure the code is code is correct, but i simply do not understand why I keep getting an error
Any idea why this may be happening?
Any help will be much appreciated :)