Excel VBA: 格式控件下拉列表填充单元格中的唯一值

Excel VBA: Format Control dropdown populating unique values in cells

Private Sub Worksheet_Activate()

Dim levelDrop As Shape
Set levelDrop = Worksheets("Sheet1").Shapes("Drop Drown 7").ControlFormat

If levelDrop.ListIndex = 1 Then

Worksheets("Sheet1").Range("B31:B") = Worksheets("Control_Sheet").Range("I3:I213").RemoveDuplicates

End If

End Sub

我不知道是什么问题。我一直收到一条错误消息

"The item with the specified name was not found".

错误指向的行是Set语句。怎么回事?

您确定这是您的控件的正确名称吗:Drop Drown 7

通常他们被命名为 Dropdown 7