Is it possible to define a VBA function so it will only accept specific predefined values as parameter values? As example, if I create a function like this:
Function Test(vTxt as Boolean)
Msgbox vText
End Function
and call it from any other Sub I have to give True or False for vTxt, and it won't accept any other values. For example, I can call Test as:
Sub Example ()
Call Test(True)
End Sub
Like that, can I set up other parameters in the function so that the caller must choose from only predetermined options? For example:
Function Test2(vTxt as <something>)
Msgbox vText
End Function
and when calling Test2, the caller must specify Option 1, Option 2 or Option 3 for variable vTxt. I don't want to create multiple optional arguments, but just one argument with multiple predetermined values. What can I use for <something>?
Select Casemethod - TenderShortGoldenRetriever