OptionButton caption to Combox1

JohnBi

New Member
Joined
Aug 1, 2016
Messages
31
Office Version
  1. 2019
Platform
  1. Windows
Hi,
I have a Frame3 with 10 OptionButton.
How can I update a Combox1 value with the OptionButton caption once the option itself is selected?
Thank you and regards
John
 

Excel Facts

Repeat Last Command
Pressing F4 adds dollar signs when editing a formula. When not editing, F4 repeats last command.
It's not pretty, but it should work (once you change the button names to your naming convention).

VBA Code:
Private Sub opt1_Click()

Combox1.AddItem opt1.Caption

End Sub

Private Sub opt2_Click()

Combox1.AddItem opt2.Caption

End Sub

Private Sub opt3_Click()

Combox1.AddItem opt3.Caption

End Sub

Private Sub opt4_Click()

Combox1.AddItem opt4.Caption

End Sub

Private Sub opt5_Click()

Combox1.AddItem opt5.Caption

End Sub

Private Sub opt6_Click()

Combox1.AddItem opt6.Caption

End Sub

Private Sub opt7_Click()

Combox1.AddItem opt7.Caption

End Sub

Private Sub opt8_Click()

Combox1.AddItem opt8.Caption

End Sub

Private Sub opt9_Click()

Combox1.AddItem opt9.Caption

End Sub

Private Sub opt10_Click()

Combox1.AddItem opt10.Caption

End Sub
 
Upvote 0

Forum statistics

Threads
1,215,427
Messages
6,124,831
Members
449,190
Latest member
rscraig11

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top