Dim someNumber As Variant
Dim myIntegerNumber as Integer
Set someNumber = GetTheNumber("Seven") ' Fails
If someNumber = Nothing Then ... End If
If someNumber = 5 Then myIntegerNumber = someNumber
If GetTheNumber returns Nothing this works fine. If it returns 7 then the code falls over for trying to use Set with a number.
Likewise, if I invert it so it just does someNumber = GetTheNumber("Seven") then it will work for 7 but fail for Nothing.
How can I solve this problem or is there a better way of having my function indicate the operation couldn't be completed?