您好我正在尝试为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