populate combobox in VBA with array elements

前端 未结 2 559
慢半拍i
慢半拍i 2021-01-13 14:56

I have a VBA procedure (in Excel 2007) where I aspire to set the ListFillRange property of a combobox styled as a list using an array.

I know this works if I right c

2条回答
  •  暖寄归人
    2021-01-13 15:32

    I know its late but maybe it is going to help someone else. At least the following code works (much faster than element for element) for me.

    dim arr() as variant
    
    arr = Worksheets("Total").Range("C2:"&lrow).Value
    Worksheets("Menu").ComboBox2.List = arr
    

提交回复
热议问题