I want to filter combobox1 to display 1 item from my list, but it does not work. I tried to put condition on worksheet, but still not working.
Code:
Public Sub Worksheet_Initialize()
With ComboBox1
If OptionButton2.Enabled = True Then
.Clear
.AddItem "All"
End If
If OptionButton3.Enabled = True Then
.Clear
.AddItem "One"
.AddItem "Two"
.AddItem "Three"
.AddItem "Four"
End If
End With
With ComboBox2
.Clear
.AddItem "Item 1"
.AddItem "Item 2"
.AddItem "Item 3"
.AddItem "Item 4"
End With
End Sub
Private Sub OptionButton1_Click()
If OptionButton1.Enabled = True Then
ComboBox1.Enabled = False
OptionButton2.Enabled = True
OptionButton3.Enabled = True
Else
ComboBox2.Enabled = False
End If
End Sub
Private Sub OptionButton2_Click()
If OptionButton2.Enabled = True Then
ComboBox1.Enabled = True
End If
End Sub
Private Sub OptionButton3_Click()
If OptionButton2.Enabled = True Then
ComboBox1.Enabled = True
End If
End Sub
Private Sub OptionButton4_Click()
If OptionButton4.Enabled = True Then
ComboBox2.Enabled = True
ComboBox1.Enabled = False
OptionButton2.Enabled = False
OptionButton3.Enabled = False
End If
End Sub