Hello everybody,
I´m trying to link two option buttons to a Combobox and I´m a bit lost...
The two option buttons are form elements and the ComboBox is an activex element. It doesnt have to be necessarily like this, actually this could be part of the problem.
I´ve written the following code and placed it in the VBA Editor under a Sheet Object with the same name of the Excel Sheet where the buttons and the combobox are placed:
Private Sub ComboBox1_Change()
Dim rRange As Range
Dim VisibleRange As Range
If [FilterModeButton] = 1 Then
Set rRange = Worksheets("Main").Range("S9:S2246")
End If
If [FilterModeButton] = 2 Then
Set rRange = Worksheets("Main").Range("V9:V2246")
End If
Set VisibleRange = rRange.SpecialCells(xlCellTypeVisible)
Worksheets("RSO_Aux1").ComboBox1.Clear
For Each rcell In VisibleRange
Worksheets("RSO_Aux1").ComboBox1.AddItem rcell
Next
End Sub
As you can see, my purpose is to load different ranges in the combobox depending on what option is selected.
The problem is, when I try to link the option buttons to this macro ( Assign macro, contextual-right click menu on the option buttons), the macro name is not displayed as available...I´m quite new at VBA Programming and still lacking of knowledge to understand this simple issue...
Could please someone here help me?
Thanks in advance,
Ruben
Bookmarks