![]() |
![]() |
|
|||||||
| 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 |
|
Guest
Posts: n/a
|
Hi all,
I am creating a form and have two togglebuttons and a combobox. I want it so that if the first togglebutton is pressed, the list in the combobox stays the same, but if the 2nd togglebutton is selected, a different list comes up in the combobox. Can anyone help with this one? |
|
|
|
#2 |
|
MrExcel MVP
Join Date: Feb 2002
Location: Newcastle, UK
Posts: 1,174
|
Is this a real form or 1 on the sheet itself using Controls Toolbox activex objects, if the latter then i can help you.
Ian Mac |
|
|
|
|
|
#3 |
|
Guest
Posts: n/a
|
It's a form I designed myself using VBA
|
|
|
|
#4 |
|
Board Regular
Join Date: Feb 2002
Location: Where the wild roses grow
Posts: 285
|
instead of filling the combobox on the userform.initialise event do it on the
toggle button click event as follows: sub togglebutton1.click () if togglebutton1.value = true then combobox1.clear combobox1.additem "something1" combobox1.additem "something2" combobox1.additem "something3" combobox1.additem "something4" end if end sub you need to clear the combobox first otherwise it will just keep adding to it. |
|
|
|
|
|
#5 |
|
Guest
Posts: n/a
|
Perfect! Thank you!
|
|
![]() |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|