Sub/Function Arguments

  • Thread starter Thread starter MPM1100
  • Start date Start date
M

MPM1100

I am wondering if it is possible to provide options for Sub/Function
arguments just as VB does for intrisic methods, so that when a user is typing
out the method call, a drop down box appears for each argument showing
available options?

Thanks In Advance
 
MPM1100 said:
I am wondering if it is possible to provide options for Sub/Function
arguments just as VB does for intrisic methods, so that when a user is
typing
out the method call, a drop down box appears for each argument showing
available options?

Thanks In Advance

Yes, just set up Public Enums, like this:

Public Enum MyData_Enum
mdOption1 = 1
mdOption2 = 2
End Enum

Then, to specify it as a parameter data type:

Public Sub MySub(opt As MyData_Enum)
Select Case opt
Case 1: Debug.Print "Option 1 chosen"
Case 2: Debug.Print "Option 1 chosen"
End Select
End Sub

Not a very enlightening example, but hopefully you get the idea.
 
I posted this question in general questions too and got the answer just as
you have stated. Both answers are greatly appreciated.

Best

MPM
 
Back
Top