【发布时间】:2019-11-27 12:01:49
【问题描述】:
我在看这个问题:How to create and populate ActiveX combo box
我想知道,当项目列表来自某个范围时,如何实现以及如何指定列表应该放置在哪个单元格中。
此外,从两个不同的工作表中获得一系列值可能会很好。
Sub CreateComboBox1()
With ActiveSheet.OLEObjects.Add(ClassType:="Forms.ComboBox.1", _
Link:=False, DisplayAsIcon:=False, Left:=50, Top:=80, Width:=100, _
Height:=15)
With .Object
.AddItem "Date"
.AddItem "Player"
.AddItem "Team"
.AddItem "Goals"
.AddItem "Number"
End With
End With
End Sub
【问题讨论】:
标签: excel vba combobox activex