Hi
I'm trying to write a code that will set the rowsource for 3 comboboxes that is dependent on which optionbox is selected. I have 2 optionboxes.
These are all form controls and are in my worksheet.
Here is the code I am trying:
The two optionsbuttons have a macro assigned to them OptionButton1_Click for optionbutton1 and OptionButton2_Click for optionbutton 2.
I was hoping that the code called options would do the rest.
The code I am using was found on internet but I not entirely sure that it is to used in the way that I intend it to.
Anyway when I click on an optionbutton I am getting this message:
Runtime error 438: Object dosen't support this property or method.
What are I doing wrong or are I even on the right track with my code?
Cheers
I'm trying to write a code that will set the rowsource for 3 comboboxes that is dependent on which optionbox is selected. I have 2 optionboxes.
These are all form controls and are in my worksheet.
Here is the code I am trying:
Code:
Sub OptionButton1_Click()
Call Options
End Sub
Sub OptionButton2_Click()
Call Options
End Sub
Sub Options()
Select Case True
Case OptionButton1
Sheets("SELECTIONS").Shapes("combobox1").RowSource = "todays_races"
Sheets("SELECTIONS").Shapes("combobox2").RowSource = "todays_runners"
Sheets("SELECTIONS").Shapes("combobox3").RowSource = "systems"
Case OptionButton2
Sheets("SELECTIONS").Shapes("combobox1").RowSource = "tomorrows_races"
Sheets("SELECTIONS").Shapes("combobox2").RowSource = "tomorrows_runners"
Sheets("SELECTIONS").Shapes("combobox3").RowSource = "systems"
Case Else
Sheets("SELECTIONS").Shapes("combobox1").RowSource = "todays_races"
Sheets("SELECTIONS").Shapes("combobox2").RowSource = "todays_runners"
Sheets("SELECTIONS").Shapes("combobox3").RowSource = "systems"
End Select
End Sub
The two optionsbuttons have a macro assigned to them OptionButton1_Click for optionbutton1 and OptionButton2_Click for optionbutton 2.
I was hoping that the code called options would do the rest.
The code I am using was found on internet but I not entirely sure that it is to used in the way that I intend it to.
Anyway when I click on an optionbutton I am getting this message:
Runtime error 438: Object dosen't support this property or method.
What are I doing wrong or are I even on the right track with my code?
Cheers