View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
K Dales[_2_] K Dales[_2_] is offline
external usenet poster
 
Posts: 1,163
Default Option Buttons and List Boxes

Here is a solution that is not terribly elegant, but easy!
Create two list boxes, one for each list. Make them the same size and place
one directly over the other. Then create the option buttons and use these as
their _Click() event procedures:

Sub OptionButton1_Click()

ActiveSheet.Shapes("List Box 1").Visible = True
ActiveSheet.Shapes("List Box 2").Visible = False

End Sub
Sub OptionButton2_Click()

ActiveSheet.Shapes("List Box 2").Visible = True
ActiveSheet.Shapes("List Box 1").Visible = False

End Sub

Both list boxes should be functional, but one will always be hidden so to
the user it will appear and function as if there is one box but the options
change.

"Sue" wrote:

hi there

I need to know how to activate some option buttons (only 2 of them,
assuming they are what's best) on a list box, so that depending on
which option button the user selects, the list within the list box
changes to reflect their choice, eg:

User selects option button 1 (called "Fruit")
Input range in listbox changes to reflect the list containing apples,
pears, oranges etc

User selects option button 2 (called "Cars")
Input range in listbox changes to reflect the list containing Honda,
Mazda, Porsche, Toyota etc

The user then makes their selection, clicks ok and their choice is
returned to the relevant cell..


appreciate any help

cheers and regards
Sue