0

通过形状对象创建组合框后,我在选择组合框时遇到问题。有人可以帮忙吗?

我的代码是

Dim comboBoxRange As Range
Set comboBoxRange = Sheets(axleDataWindowName).Range("F2:F4")
currentSheet.DropDowns.Add(20, 40, 100, 15).Name = "modifiedComboBox"
With currentSheet.Shapes("modifiedComboBox")
    .Left = 450
    .List comboBoxRange.Value
End With
4

1 回答 1

1

您需要调用currentSheet.Dropdowns("modifiedComboBox")而不是currentSheet.Shapes("modifiedComboBox"). 也使用.AddItem代替.List

Dim comboBoxRange As Range
Set comboBoxRange = Sheets(axleDataWindowName).Range("F2:F4")
currentSheet.DropDowns.Add(20, 40, 100, 15).Name = "modifiedComboBox"
With currentSheet.Shapes("modifiedComboBox")
    .Left = 450
    .AddItem comboBoxRange.Value
End With
于 2013-10-09T18:14:24.493 回答