Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 260
Default ListBox Multiple Selection

Hey guys

I have a ListBox(ListBox1) that is populated with values.
lets say these matching values can be found in Range
E8:E20. They may or may not be in this range. If a value
that is in the ListBox is matches a value in Range E8:E20,
I need for that value in the ListBox to be selected. How
do I do this?

Thank you
Todd Huttenstine
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default ListBox Multiple Selection

Hi Todd,

here is some code

Dim i As Long
Dim j As Long

With Me.ListBox1
For i = 0 To .ListCount - 1
On Error Resume Next
j = WorksheetFunction.Match(.List(i), Range("E8:E20"), 0)
If j 0 Then .Selected(i) = True
j = 0
Next i
End With

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"Todd Huttenstine" wrote in message
...
Hey guys

I have a ListBox(ListBox1) that is populated with values.
lets say these matching values can be found in Range
E8:E20. They may or may not be in this range. If a value
that is in the ListBox is matches a value in Range E8:E20,
I need for that value in the ListBox to be selected. How
do I do this?

Thank you
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
Listbox selection ub Excel Discussion (Misc queries) 0 March 10th 09 06:43 PM
Listbox Selection Displays the Column. Scott Halper Excel Worksheet Functions 3 February 3rd 07 10:36 AM
protect cells after listbox selection Chay Excel Discussion (Misc queries) 3 December 1st 06 11:56 AM
Listbox & Selection sparx Excel Discussion (Misc queries) 0 July 31st 06 10:48 PM
Run a macro when new selection in listbox Georg[_3_] Excel Programming 1 December 5th 03 06:09 PM


All times are GMT +1. The time now is 09:11 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"