View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
Jim Cone Jim Cone is offline
external usenet poster
 
Posts: 3,290
Default Setting a list box to a value

Scott,

Listbox1.ListIndex = 3 ' selects the fourth item

-1 is no selection
0 is the first item
Listbox1.ListCount -1 = number of items in list box
--
Jim Cone
San Francisco, USA
http://www.officeletter.com/blink/specialsort.html



"Riddler" wrote in message oups.com...
I use the .additem to initially load the listbox and then use the .text
of it to make a selection through code. It works but as I stated not
consistently. Is there some other way to preselect a item in a listbox
using code when the list has already been created?

Thanks
Scott