I am using optionbuttons to change the assignment of Combobox's range between two columns.
This code works fine to select the range for only one column:
When I added If statements selecting either of the two lists in different columns, the code always selects column B's range:
Does anyone in the forum see what I am doing wrong?
Thanks,
Art
This code works fine to select the range for only one column:
Code:
Private Sub ComboBox_Set_Rng()
If ComboBox1.Enabled = True Then
With ActiveSheet.Shapes("Combobox1")
.OLEFormat.Object.ListFillRange = "A2:A20"
End With
End If
End Sub
When I added If statements selecting either of the two lists in different columns, the code always selects column B's range:
Code:
Private Sub ComboBox_Set_Rng()
If ComboBox1.Enabled = True Then
If OptionButton1 = True Then
With ActiveSheet.Shapes("Combobox1")
.OLEFormat.Object.ListFillRange = "A2:A20"
End With
Else
If OptionButton2 = True Then
With ActiveSheet.Shapes("Combobox1")
.OLEFormat.Object.ListFillRange = "B2:B20"
End With
End If
End If
End If
End Sub
Does anyone in the forum see what I am doing wrong?
Thanks,
Art