Hi all,
I'm trying to include 2 lists for my Combox listing, but it's not working....
Here's my code and I hope someone here is able to help out
Private Sub OptionButton1_Click()
End Sub
Private Sub OptionButton2_Click()
End Sub
Private Sub OptionButton3_Click()
End Sub
Private Sub OptionButton5_Click()
End Sub
Private Sub OptionButton6_Click()
End Sub
Private Sub ComboBox1_Change()
End Sub
Private Sub ComboBox2_Change()
End Sub
Private Sub ComboBox3_Change()
End Sub
Private Sub UserForm_Initialize()
OptionButton1.Value = True
OptionButton2.Value = False
OptionButton3.Value = True
OptionButton4.Value = False
OptionButton5.Value = True
OptionButton6.Value = False
ComboBox1.Clear
ComboBox2.Clear
ComboBox3.Clear
If OptionButton1 = True Then
With UserForm3.ComboBox1
.AddItem "1"
.AddItem "2"
.AddItem "3"
.AddItem "4"
.AddItem "5"
.AddItem "6"
.AddItem "7"
End With
Else If OptionButton2 = True Then
With UserForm3.ComboBox1
.AddItem "2"
.AddItem "4"
.AddItem "6"
.AddItem "8"
End With
End If
If OptionButton3 = True Then
With UserForm3.ComboBox2
.AddItem "1"
.AddItem "2"
.AddItem "3"
.AddItem "4"
.AddItem "5"
.AddItem "6"
.AddItem "7"
End With
Else If OptionButton4 = True Then
With UserForm3.ComboBox2
.AddItem "2"
.AddItem "4"
.AddItem "6"
.AddItem "8"
End With
End If
If OptionButton5 = True Then
With UserForm3.ComboBox3
.AddItem "1"
.AddItem "2"
.AddItem "3"
.AddItem "4"
.AddItem "5"
.AddItem "6"
.AddItem "7"
End With
Else If OptionButton6 = True Then
With UserForm3.ComboBox3
.AddItem "2"
.AddItem "4"
.AddItem "6"
.AddItem "8"
End With
End If
So the codes runs without issue, but if I select OptionButton 2 or 4 or 6, ComboBox still has the option of 1-7, not 2,4,6,8
I would be grateful if someone can share insignts
I'm trying to include 2 lists for my Combox listing, but it's not working....
Here's my code and I hope someone here is able to help out
Private Sub OptionButton1_Click()
End Sub
Private Sub OptionButton2_Click()
End Sub
Private Sub OptionButton3_Click()
End Sub
Private Sub OptionButton5_Click()
End Sub
Private Sub OptionButton6_Click()
End Sub
Private Sub ComboBox1_Change()
End Sub
Private Sub ComboBox2_Change()
End Sub
Private Sub ComboBox3_Change()
End Sub
Private Sub UserForm_Initialize()
OptionButton1.Value = True
OptionButton2.Value = False
OptionButton3.Value = True
OptionButton4.Value = False
OptionButton5.Value = True
OptionButton6.Value = False
ComboBox1.Clear
ComboBox2.Clear
ComboBox3.Clear
If OptionButton1 = True Then
With UserForm3.ComboBox1
.AddItem "1"
.AddItem "2"
.AddItem "3"
.AddItem "4"
.AddItem "5"
.AddItem "6"
.AddItem "7"
End With
Else If OptionButton2 = True Then
With UserForm3.ComboBox1
.AddItem "2"
.AddItem "4"
.AddItem "6"
.AddItem "8"
End With
End If
If OptionButton3 = True Then
With UserForm3.ComboBox2
.AddItem "1"
.AddItem "2"
.AddItem "3"
.AddItem "4"
.AddItem "5"
.AddItem "6"
.AddItem "7"
End With
Else If OptionButton4 = True Then
With UserForm3.ComboBox2
.AddItem "2"
.AddItem "4"
.AddItem "6"
.AddItem "8"
End With
End If
If OptionButton5 = True Then
With UserForm3.ComboBox3
.AddItem "1"
.AddItem "2"
.AddItem "3"
.AddItem "4"
.AddItem "5"
.AddItem "6"
.AddItem "7"
End With
Else If OptionButton6 = True Then
With UserForm3.ComboBox3
.AddItem "2"
.AddItem "4"
.AddItem "6"
.AddItem "8"
End With
End If
So the codes runs without issue, but if I select OptionButton 2 or 4 or 6, ComboBox still has the option of 1-7, not 2,4,6,8
I would be grateful if someone can share insignts