LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #9   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 166
Default Selected... or not ??

On Thu, 4 Jun 2009 09:46:11 +0100, "Patrick Molloy"
wrote:

Thanks for the rundown. Learning more all the time.. ceratinly all
this multiple firing and what's called and in what sequencecan be hard
to follow. By the waycould you explain what 'Control Source' is in
relation to a listbox, please?
Not the Excel help, which I can't fathom, but in normal English? :)

Thanks... there was another thread but it went cold, and there
was no answer.
Cheers - Kirk



any time you click an item in a listbox control, the change event fires.
when an item is selected using the SELECTED property, it also fires the
change event. The change event will fire even if the item state doesn't
change

so
listbox1.selected(5)=True
listbox1.selected(5)=True
will fire twice even though the 2nd line doesn't change the property value.
imagine it like the worksheet change event. it will fire if you type A into
a cell. it will fire again if you type A into the same cell


for a multiselect you test if an item is selected

with listbox1
for i = 0 to .listcount-1 'zero based
if .selected(i) then
'item i is selected
end if
next
end with

an item is selected by using this code
listbox1.selected(index)=True
and deselected by
listbox1.selected(index)=False

 
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
Multiple cells or columns are selected instead of selected cell or Mikey Excel Discussion (Misc queries) 1 April 29th 09 09:48 PM
Cells are selected but aren't displayed as selected Nifty Excel Discussion (Misc queries) 2 September 17th 06 07:22 PM
Cells are selected but aren't displayed as selected Nifty Excel Worksheet Functions 0 September 17th 06 11:34 AM
Macro to take selected cells times a selected cell Craig Excel Programming 4 October 24th 05 12:54 AM
how do i make it so that when a sheat is selected either via link or tab, that xlLastCell is selected. the last on the sheet. Daniel Excel Worksheet Functions 1 July 12th 05 01:30 AM


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