Answers for "Excel VBA Function Overloading and UDF"

VBA
1

Excel VBA Function Overloading and UDF

'Suggestion by Joel Spolsky himself...

Public Function Foo(Optional v As Variant) As Variant

    If IsMissing(v) Then
        Foo = "Missing argument"
    ElseIf TypeName(v) = "String" Then
        Foo = v & " plus one"
    Else
        Foo = v + 1
    End If

End Function
Posted by: Guest on April-01-2020

Code answers related to "VBA"

Browse Popular Code Answers by Language