#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10
Default listboxes

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default listboxes

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10
Default listboxes

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 260
Default listboxes

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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Form/Listboxes -- problems Stuart[_5_] Excel Programming 2 May 7th 04 07:23 AM
Listboxes Lionel Fridjhon Excel Programming 0 April 5th 04 06:28 PM
Single Selection ListBoxes jacqui[_2_] Excel Programming 4 February 10th 04 03:16 PM
Linked ListBoxes Phill Excel Programming 1 February 6th 04 04:54 PM
ListBoxes - correct syntax Bob Phillips[_5_] Excel Programming 0 September 17th 03 02:02 PM


All times are GMT +1. The time now is 06:45 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"