错误381,无法设置List属性。 无效的属性数组索引
嗨,我想分配值的combobox,但得到运行时错误381.有谁知道为什么? 这里是错误发生的代码 –
LastAddress = Sheets("TempList").Range("A100").End(xlUp).Address ComboBox1.List = "TempList!A2:" & LastAddress
非常感谢!
这是修改后的代码。 非常感谢。
Dim myArray As Variant Dim wss As Worksheet Set wss = Sheets("TempList") With wss LastRow = .Cells(.Rows.Count, "A").End(xlUp).Row myArray = Sheets("TempList").Range("A2:A" & LastRow) Sheets("CompRecTool").Activate ComboBox1.List = myArray End With