Custom type???

buratti

Registered User.
Local time
Today, 17:14
Joined
Jul 8, 2009
Messages
234
Im not sure if my title is the correct terminology, but I am writing a function in VBA that I will need to call many times in my future designing. One of the parameters being sent to this function will be one of 5 set options. What I want is when I am calling that function within VBA editor, when I get to that parameter, I want a list box to display with the options to choose from. Just like some of the built in functions do. For example, when using the msgbox() function i type:

msgbox "hello world",vbokonly

After I type the comma after "hello world" I get a drop down menu with a list of options to select, vbokonly being one of the options. How do i set up my function so when i call it from within VBA editor, i get a similar display/shortcut with my custom options/values?
 
Once you create the function in a common module save and compile it, it will give you the options.. I have a common (public) function called "ListFilesToTable", so when I start typing.. it shows them..

attachment.php
 

Attachments

  • show.png
    show.png
    5.8 KB · Views: 153
Thanks. I dont know if I am misunderstanding your answer or you are misunderstanding my question, but to go back to my msgbox() example, notice where the arrow is pointing to in my attached picture. Do you see the "drop down" options I can select from? I named my post "Custom Type" because I can only asssume this is what I need to do, but dont know if I am correct on that assumption, nor how to create one with the values I need. So my function would look something like this:

Public Function MyFunction (type as mycustomtype, value as string)
...
End Function

When I try to call the function from wherever, after I type "MyFunction(", I would get the dropdown similar to what I pointed out in the attachment but only with my custom values like Value1, value2, value3, etc.

Any other thoughts, or did I just completely misunderstand your suggestion?
 

Attachments

  • screenshot.png
    screenshot.png
    10.3 KB · Views: 77

Users who are viewing this thread

Back
Top Bottom