VBA equivalent to Enum in C

J

Jay

Is there anything similar to the enum statement in C?

Eg, I can have four constants defined using this statement (if I remember my C correctly):

enum {NONE=0, TEST=1, ERROR=5, RETRY=7};
 
J

Jezebel

gee, well yes it does. It's called enum, oddly enough.

Public Enum MyENumValues
None = 0
Test = 1
Error = 5
Retry = 7
End Enum


The value assignments are optional. If omitted, sequential values are
assigned automatically.
 
J

Jay

Thanks Jezebel. Sorry for my late reply - very helpful.


Is there an equivalent to
gee, well yes it does. It's called enum, oddly enough.

Public Enum MyENumValues
None = 0
Test = 1
Error = 5
Retry = 7
End Enum


The value assignments are optional. If omitted, sequential values are
assigned automatically.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top