Is there a way to count elements in a VBA enum?

后端 未结 5 1989
无人及你
无人及你 2021-02-09 14:29

is there a proper way to count elements of an enum in VBA ? At the moment, I leave an enum value such as KeepThisOneHere in the following example

En         


        
5条回答
  •  生来不讨喜
    2021-02-09 15:06

    If you know the enum type(s) on design-time you could transform them into a Static Property Get MyEnumColl() as Collection ... (no class needed, initialized on 1st access statically) and thus easily loop through them or count them like shown here

提交回复
热议问题