我试图将宏分配给一个活动的x组合框我已经完成了表单控件版本并且它可以工作但是当我在活动x上尝试相同的事情时我会一直收到错误,我错过了什么?
listfillrange在30_06_16和29_06_16的所选单元格上显示正常,只要您点击任意日期的列表,就会出现错误
宏1:30_06_16 Macro2:29_06_16
表单控件组合框:
Sub DropDown13_Change()
With ThisWorkbook.Sheets("Sheet2").Shapes("Drop Down 13").ControlFormat
Select Case .List(.Value)
Case "30_06_2016": 30_06_16
Case "29_06_2016": 29_06_16
End Select
End With
End Sub
活动x组合框:
Private Sub ComboBox2_Change()
With ThisWorkbook.Sheets("Sheet2").Shapes("Combo Box 2").ControlFormat
Select Case .List(.Value)
Case "30_06_2016": Bank_Prompt_30_06_16
Case "29_06_2016": Bank_Prompt_29_06_16
End Select
End With
End Sub
表单控件很好只是活动x,可能缺少明显的东西,但任何帮助都很受欢迎。
答案 0 :(得分:0)
The syntax for ActiveX is completely different:
Private Sub ComboBox2_Change()
With ThisWorkbook.Sheets("Sheet2").ComboBox2
Select Case .List(.ListIndex)
Case "30_06_2016": Bank_Prompt_30_06_16
Case "29_06_2016": Bank_Prompt_29_06_16
End Select
End With
End Sub