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

后端 未结 5 2000
无人及你
无人及你 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:09

    there isn't a way to get the count.

    What you have to do is loop through the elements of the Enum until you get to the last one.

    Chip Pearson has some good tips on Enumerated constants: Chip Pearson: Enum Variable Type

提交回复
热议问题