Tested in Excel 365 (16.8730.2046) 64-bit
There are cases when your functions gets arguments that are not so easy to remember or are prone to be misspelled. A dropdown list with possible arguments would save a lot of time. This can be achieved by creating a user defined type using enum. Here are some examples:
- Public Enum ENM_RegistryOperation
- RegistryRead
- RegistryWrite
- RegistryDelete
- End Enum
- '
- Public Enum ENM_RegistryKeyType
- REG_SZ
- REG_EXPAND_SZ
- REG_DWORD
- End Enum
- '
- Public Enum ENM_FileOpenType
- FileRead
- FileAppend
- FileOverwrite
- FileRandom
- FileBinary
- End Enum
First 2 types are used in this example.
The third one is used in this example.
You can also use Enum to store specific values under a more user friendly name.
- Public Enum myOS
- Windows7 = 6.1
- Windows8 = 6.2
- Windows81 = 6.3
- Windows10 = 10
- ' etc
- End Enum
See all Windows version here.
Later edit: I have found more info and examples about Enum on this site.