Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

excel listbox question - repost 1

Status
Not open for further replies.

cmeyers

Programmer
Jul 6, 2001
24
US
I have a behavior issue with respect to a listbox I have inserted into an excel worksheet.

Initially...upon loading the workbook...and activating the worksheet...
When I first select an item in the listbox, that item remains highlighted when I select another item. Although this does not have an adverse effect on my application it is annoying and could confuse the user. BTW - the MultiSelect property is set to 0 (fmMultiSelectSingle).

Any ideas?

Thanks in advance!
 
I have not had this problem, so this is just a shot in the dark.

In ListBox_Click(), try Me.Refresh to refresh the form.
 
CraigMan,

Oddly enough, I have experienced a similar problem with a single ListBox on a worksheet. In my case, I was trying to make the ListBox Visible property FALSE and the behavior was not consistant. Whereas, the ComboBox would behave consistantly.

I just tried adding both a ListBox and a ComboBox to a worksheet
1. Making each visible when I select certain cells
2. Making each invisible after making a selection or
3. Making each invisible when selecting NOT certain cells.

THAT DID work consistantly for both. So...

DOES ListBox have some inherant bug?

I DUNNO? :cool: Skip,
metzgsk@voughtaircraft.com
 
I will try using referesh and will also fool around some with the visible property. It is possible there is a bug in the listbox control.

Thanks for the ideas.
 
What I finally found that works is this:

Code:
ListBox1.ListIndex = -1

(meaning "no rows selected")

placed at the end of
Code:
ListBox1_DblClick
 
Thanx CraigMan!

A STAR for your perseverance! Skip,
metzgsk@voughtaircraft.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top