![]() |
![]() |
|
|||||||
| Excel Questions All Excel/VBA questions - formulas, macros, pivot tables, general help, etc. Please post to this forum in English only. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Board Regular
Join Date: Feb 2002
Location: Where the wild roses grow
Posts: 285
|
Hi,
I have a togglebutton and a combobox (which contains Yes, No and Maybe in it) on a userform I've designed. If I push the togglebutton I want Yes to be automatically displayed in the combobox. What line of code will I need to do this? If it helps, the userform is called Userform2, the togglebutton is Togglebutton1 and the Combobox is called Combobox2 Thanks for any help |
|
|
|
|
|
#2 |
|
Banned
Join Date: Feb 2002
Posts: 1,582
|
Hi
Try something like: Private Sub ToggleButton1_Click() Dim strReply As String Select Case ToggleButton1.Value Case True strReply = "Yes" Case False strReply = "No" End Select ComboBox1 = strReply End Sub |
|
|
|
|
|
#3 |
|
Board Regular
Join Date: Feb 2002
Location: Where the wild roses grow
Posts: 285
|
Thanks Dave, that works great
|
|
|
|
![]() |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|