I have a user defined function (UDF) that receives two inputs: Base Currency (Base_Ccy) and Term Currency (Term_Ccy) as Variant data types. The currency inputs in question are EUR, GBP, NZD, AUD, and USD. Depending on the Base_Ccy and Term_Ccy inputs, I'd like the UDF to perform different functions. I am trying to write a Select Case statement with the operator "And" to test Base_Ccy and Term_Ccy in each case. For example:
Select Case Base_Ccy And Term_Ccy
'(Base Ccy)
Case "EUR", "GBP", "NZD", "AUD"
'(Term_Ccy)
Case Is <> "EUR", "GBP", "NZD", "AUD"
'(Both Inputs)
Case Base_Ccy <> Term_Ccy
FX_Converter = 1
Case Else
FX_Converter = 0
End Select
To put it into words:
FX_Converter should equal 1 only if
1) Base_Ccy equals EUR, GBP, NZD, or AUD
2) Term_Ccy does not equal EUR, GBP, NZD or AUD
3) Base_Ccy is not equal to Term_Ccy
Otherwise, FX_Converter should equal 0.
Is it possible to write "Select Case X And Y" where I can test both 'X' and 'Y'?
Any words of advice would be most appreciated.
Bookmarks