Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 156
Default Listbox question please


What should the command ...

Me.List1.ListIndex = t

.... actually do ?

Should it set line t as the selected line in the list box, and also be
highlit ... or not ?

Thanks - Kirk
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 156
Default Listbox question please

On Sun, 18 Mar 2007 23:46:33 +1200, kirkm
wrote:

A little bit later I substituted

List1.Selected(t) = True

This seemed to work better and I first
thought you don't set List1.listIndex= anything.

List1.Selected(t) by itself is all that required.

However, this also fails about 1 time in 12.

For an experiment I added

List1.Selected(t) = True
Do
Loop Until List1.Selected(t) = True
MsgBox List1.Selected(t)


Every time row t was highlit, the msgbox output was True.

But also, when it *wasn't* highlit, it also said True.

Does this make sense to anyone?

Thanks - Kirk
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,986
Default Listbox question please

There is a pretty comprehensive explanation for the selected property in VBA
help. There are also example code snippets.

"kirkm" wrote:

On Sun, 18 Mar 2007 23:46:33 +1200, kirkm
wrote:

A little bit later I substituted

List1.Selected(t) = True

This seemed to work better and I first
thought you don't set List1.listIndex= anything.

List1.Selected(t) by itself is all that required.

However, this also fails about 1 time in 12.

For an experiment I added

List1.Selected(t) = True
Do
Loop Until List1.Selected(t) = True
MsgBox List1.Selected(t)


Every time row t was highlit, the msgbox output was True.

But also, when it *wasn't* highlit, it also said True.

Does this make sense to anyone?

Thanks - Kirk

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 Question Greg B Excel Worksheet Functions 1 March 9th 05 02:17 PM
another listbox question [email protected] Excel Programming 1 February 11th 05 08:32 PM
listbox question GMet Excel Programming 1 September 27th 04 07:59 PM
ListBox Question Tom Ogilvy Excel Programming 1 August 24th 04 05:43 PM
LIstbox Question Rich Cooper Excel Programming 1 June 2nd 04 03:50 PM


All times are GMT +1. The time now is 10:13 PM.

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"