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

后端 未结 5 1992
无人及你
无人及你 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 14:59

    Sub count()
        Dim n, c
    
        For n = headers.frstItem To headers.lastItem
            c = c + 1
        Next
        Debug.Print c
    End Sub
    

提交回复
热议问题