使用“列表”或“列”属性将各项添加到列表Add items to a list using the List or Column property

  1. 创建多列**ListBox** 或**ComboBox**。Create a multicolumn ListBox or ComboBox.

  2. 创建包含要放入列表中的项的二维数组Create a two-dimensional array that contains the items you want to put in the list.

  3. 设置 ListBoxComboBoxColumnCount 属性,以便与列表中的条目数匹配。Set the ColumnCount property of the ListBox or ComboBox to match the number of entries in the list.

  4. 请执行下列操作之一:Do one of the following:

    • 将该数组指定为 List 属性的值。Assign the array as the value of the List property. ListBox 的内容将与数组的内容完全匹配。The contents of the ListBox will match the contents of the array exactly.

    • 将数组指定为 Column 属性的值。Assign the array as the value of the Column property. Column 转置行和列,因此 ListBox 的每行均与数组的对应列匹配。Column transposes rows and columns, so each row of the ListBox matches the corresponding column of the array.

另请参阅See also

支持和反馈Support and feedback

有关于 Office VBA 或本文档的疑问或反馈?Have questions or feedback about Office VBA or this documentation? 请参阅 Office VBA 支持和反馈,获取有关如何接收支持和提供反馈的指南。Please see Office VBA support and feedback for guidance about the ways you can receive support and provide feedback.