For context, I am an experienced now retired programmer with expertise in Access VBA, and a some experience of Excel, but not Excel VBA.
I am trying to create a custom function. As a test, I created this code:
If I run this code it correctly prints 92 in the immediate window.
If I put BIRTHDAY() in a cell, I get #NAME?
I suspect I'm missing something obvious, so please be kind
What am I missing?
I am trying to create a custom function. As a test, I created this code:
VBA Code:
Function BIRTHDAY()
Dim answer As String
Dim Startdate, Enddate As Date
Startdate = "3/3/1970"
Enddate = "5/6/1970"
answer = Application.WorksheetFunction.Days360(Startdate, Enddate)
Debug.Print answer
BIRTHDAY = answer
End Function
If I put BIRTHDAY() in a cell, I get #NAME?
I suspect I'm missing something obvious, so please be kind
What am I missing?