我的 excel 2007 工作表上有一些 activex 和表单控件(用于测试目的的下拉列表)。我已经使用下面的代码绑定了数据:
Private Sub ComboBox1_Change()
If ComboBox1.Value = 1 Then
ComboBox2.List = Array("a", "b", "c")
ComboBox2.Value = ComboBox2.List(0)
ElseIf ComboBox1.Value = 2 Then
ComboBox2.List = Array("A", "B", "C", "D")
ComboBox2.Value = ComboBox2.List(0)
End If
End Sub
Private Sub Worksheet_Activate()
ComboBox1.List = Array(1, 2)
ComboBox3.List = Array("Delhi", "Kolkata")
ComboBox3.Value = ComboBox3.List(0)
ComboBox4.List = Array("Delhi6", "Kolkata71")
ComboBox4.Value = ComboBox4.List(0)
End Sub
Private Sub UserForm_Initialize()
ComboBox1.List = Array(1, 2)
End Sub
但是当我重新打开我的工作表时,组合框在它们关闭的状态下打开,并且下拉列表中没有数据。请告知我错过了哪个事件?
提前致谢...