Hi,
I found out that using Enum one can have a dropdown box to choose from when inserting a parameter in a function.
enum drop-down.jpg
But how can I have the same user-defined constant in more then one Enum?
It works with standard VBA variables like vbEmpty, so why not with self made constants?
I tried this which gives the error: Ambiguous name detected
and I tried this which gives again the error: Ambiguous name detected
Any way I can solve this?
thank you.
I found out that using Enum one can have a dropdown box to choose from when inserting a parameter in a function.
enum drop-down.jpg
But how can I have the same user-defined constant in more then one Enum?
It works with standard VBA variables like vbEmpty, so why not with self made constants?
I tried this which gives the error: Ambiguous name detected
Code:
Private Const vbTest = 99 ''' = Ambiguous name detected !!!
Enum eTest1 '''gives 3 choices
vbEmpty ''' = standard VBA 1
vbLong ''' = standard VBA 3
vbTest ''' not in VBA, so I would assign 99 to it
End Enum
Enum eTest2 '''gives only 2 choices
vbEmpty ''' = standard VBA 1
vbTest ''' = Ambiguous name detected !!!
End Enum
Code:
Enum eTest1 '''gives 3 choices
vbEmpty ''' = standard VBA 1
vbLong ''' = standard VBA 3
vbTest = 99 ''' not in VBA, so I would assign 99 to it
End Enum
Enum eTest2 '''gives only 2 choices
vbEmpty ''' = standard VBA 1
vbTest = 99 ''' = Ambiguous name detected !!!
End Enum
thank you.