Why use arrays in VBA when there are collections?

前端 未结 3 563
一整个雨季
一整个雨季 2020-12-07 18:33

many people use extensively arrays in Excel/VBA to store a list of data. However, there is the collection object which in my view is MUCH MUCH more convenient (mainly: don\'

3条回答
  •  北荒
    北荒 (楼主)
    2020-12-07 19:27

    Collections that auto-resize are slower (theoretically speaking, different implementations will obviously have their own mileage). If you know you have a set number of entries and you only need to access them in a linear fashion then a traditional array is the correct approach.

提交回复
热议问题