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

Hi NG

I have populated a listbox by using listbox1.rowsource
There are many similar entries in the listbox.

The user can then an entry and the listbox_change() callback is called. In
this callback I would like to be able to extract the rownumber of the users
selection e.g. rownumber == 3 if the user chooses row 3 in the listbox. The
reason that I do not use Listbox.value is as i mentioned before the many
similar entries in the listbox.

Regards
Mark




  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 39
Default Listbox issues

Answering my own question.
Just ad 1,2,...,n in a column i the rowsource and hide the column by setting
the columnwidth property in listbox

Mark

"Mark" wrote in message ...
Hi NG

I have populated a listbox by using listbox1.rowsource
There are many similar entries in the listbox.

The user can then an entry and the listbox_change() callback is called. In
this callback I would like to be able to extract the rownumber of the

users
selection e.g. rownumber == 3 if the user chooses row 3 in the listbox.

The
reason that I do not use Listbox.value is as i mentioned before the many
similar entries in the listbox.

Regards
Mark






  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 26
Default Listbox issues

If you have singleselect use

listbox1.listindex

which returns the row number 0-based.

If you have multiselect you need to loop through the list
and check if the ith row is selected via

listbox1.selected(i)=True

ojv
-----Original Message-----
Hi NG

I have populated a listbox by using listbox1.rowsource
There are many similar entries in the listbox.

The user can then an entry and the listbox_change()

callback is called. In
this callback I would like to be able to extract the

rownumber of the users
selection e.g. rownumber == 3 if the user chooses row 3

in the listbox. The
reason that I do not use Listbox.value is as i mentioned

before the many
similar entries in the listbox.

Regards
Mark




.

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default Listbox issues

Mark,

Have you looked at the ListIndex property?

--

HTH

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

"Mark" wrote in message ...
Hi NG

I have populated a listbox by using listbox1.rowsource
There are many similar entries in the listbox.

The user can then an entry and the listbox_change() callback is called. In
this callback I would like to be able to extract the rownumber of the

users
selection e.g. rownumber == 3 if the user chooses row 3 in the listbox.

The
reason that I do not use Listbox.value is as i mentioned before the many
similar entries in the listbox.

Regards
Mark






  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 39
Default Listbox issues

Thanks thats it!!

"Bob Phillips" wrote in message
...
Mark,

Have you looked at the ListIndex property?

--

HTH

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

"Mark" wrote in message

...
Hi NG

I have populated a listbox by using listbox1.rowsource
There are many similar entries in the listbox.

The user can then an entry and the listbox_change() callback is called.

In
this callback I would like to be able to extract the rownumber of the

users
selection e.g. rownumber == 3 if the user chooses row 3 in the listbox.

The
reason that I do not use Listbox.value is as i mentioned before the many
similar entries in the listbox.

Regards
Mark








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 B conditional of input in Listbox A Kim K Excel Discussion (Misc queries) 1 October 31st 06 08:27 PM
Listbox B if LIstbox A equals Kim K Excel Discussion (Misc queries) 2 October 31st 06 07:03 PM
listbox.value not equal to listbox.list(listbox.listindex,0) ARB Excel Programming 0 October 22nd 03 12:46 AM
Is refreshing listbox rowsource in listbox click event possible? Jeremy Gollehon[_2_] Excel Programming 4 September 25th 03 06:45 PM
Sorting ListBox results or transposing ListBox values to other cells for sorting Rob[_8_] Excel Programming 1 July 9th 03 04:35 AM


All times are GMT +1. The time now is 11:43 AM.

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

About Us

"It's about Microsoft Excel"