For some reason custom functions don't seem to be running in Excel. I created the simple function below but it always returns zero as a value whether it is used as a worksheet function or called from a procedure. Anyone know what I am doing wrong or if there is a setting somewhere I am missing?
Public Function Testthisout(number As Double) As Double
result = number * number
End Function
Public Sub TESTFUNCTION()
Dim number As Double
Dim result As Double
Application.Volatile (True)
number = 4
result = Testthisout(number)
MsgBox result
End Sub