Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I have a 3 listboxes, the items in which the user can
click. How can I get make it so that if an item is clicked in listbox1 then selected items in listboxes 2 & and 3 are deselected? Many thanks |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi Mandy,
Is this what you mean? Private Sub ListBox1_Click() Me.ListBox2.ListIndex = -1 Me.ListBox3.ListIndex = -1 End Sub -- HTH Bob Phillips ... looking out across Poole Harbour to the Purbecks (remove nothere from the email address if mailing direct) "Mandy" wrote in message ... I have a 3 listboxes, the items in which the user can click. How can I get make it so that if an item is clicked in listbox1 then selected items in listboxes 2 & and 3 are deselected? Many thanks |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi Bob,
Yes that's exactly it! Thanks very much :o) Hi Mandy, Is this what you mean? Private Sub ListBox1_Click() Me.ListBox2.ListIndex = -1 Me.ListBox3.ListIndex = -1 End Sub -- HTH Bob Phillips ... looking out across Poole Harbour to the Purbecks (remove nothere from the email address if mailing direct) "Mandy" wrote in message ... I have a 3 listboxes, the items in which the user can click. How can I get make it so that if an item is clicked in listbox1 then selected items in listboxes 2 & and 3 are deselected? Many thanks . |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
below code does what I think you need....
To test, paste this entire code in a commandbutton. Private Sub CommandButton1_Click() Dim LB1Vals Dim LB2Vals Dim LB3Vals With Worksheets("Worksheet Name Here").ListBox1 For LB1Vals = 0 To .ListCount - 1 If .Selected(LB1Vals) Then MsgBox "There is an item or items selected in ListBox1" 'Clears all checks from Listbox2 and Listbox3 With Worksheets("Worksheet Name Here").ListBox2 For LB2Vals = 0 To .ListCount - 1 .Selected(LB2Vals) = False Next LB2Vals End With With Worksheets("Worksheet Name Here").ListBox3 For LB3Vals = 0 To .ListCount - 1 .Selected(LB3Vals) = False Next LB3Vals End With Exit Sub Else End If Next End With MsgBox "There were no items selected in ListBox1" End Sub Todd Huttenstine |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Form/Listboxes -- problems | Excel Programming | |||
Listboxes | Excel Programming | |||
Single Selection ListBoxes | Excel Programming | |||
Linked ListBoxes | Excel Programming | |||
ListBoxes - correct syntax | Excel Programming |