I have a vba function that returns a custom data type, defined as:
Public Type stockValue
stock As String
value As Double
End Type
You can only return data types that Excel understands from a user-defined function. Excel does not understand custom data types.
Instead you would have to return a variant array containing the 2 values from your custom data type. Then either you would array enter the function into 2 cells, or use another function such as INDEX to retrieve the value you wanted from the returned array.