J
John Wirt
I want to write a User Defined Function that returns the Year as an integer.
Using the VBA Editor, this UDF apparently cannot employ the built-in Year
worksheet function. Is this correct?
I tried this vastly simplified version of what I need:
---------------------
Public Function YcellE(NumRow As String) As Integer
Dim YearB As Integer
cellB = Replace("$B" & NumRow, " ", "")
YearB = Worksheets("Timeline").WorksheetFunction.Year(cellB)
End Function
------------------
I get error #438 "Object does not support this Property or Method."
Also, "Year" does not show up in the Editor as one of the options after
entering "WorksheetFunction."
If fact, very few of the vast collection of built-in functions show up.
Thanks.
John Wirt
Using the VBA Editor, this UDF apparently cannot employ the built-in Year
worksheet function. Is this correct?
I tried this vastly simplified version of what I need:
---------------------
Public Function YcellE(NumRow As String) As Integer
Dim YearB As Integer
cellB = Replace("$B" & NumRow, " ", "")
YearB = Worksheets("Timeline").WorksheetFunction.Year(cellB)
End Function
------------------
I get error #438 "Object does not support this Property or Method."
Also, "Year" does not show up in the Editor as one of the options after
entering "WorksheetFunction."
If fact, very few of the vast collection of built-in functions show up.
Thanks.
John Wirt