Excel VBA command line disable issue

I am trying to enable / disable a combo box based on the value or status of a second combo box in Excel 2007.

I think my code should look something like this:

Sub DropDown266_Change()
    If DropDown266.Index = 2 Then
        DropDown267.Enabled = False
    End If
End Sub

      

However, I am getting a "424" runtime error saying that an object is required. I'm sure this is a very simple change, but I can't figure it out. Let me know if you need more information.

+2


a source to share


2 answers


The syntax for getting the index is ComboBox1.ListIndex.



+1


a source


Try using Me.DropDown266.Index



Also you can use Intellisense to check if the Combobox exists: type Me.Dro and see if DropDown266 appears in the list.

0


a source







All Articles