Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Excel / Programming / September 2007

Tip: Looking for answers? Try searching our database.

select listbox item

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
geebee - 21 Sep 2007 17:54 GMT
hi,

i would like to know how i can select a listbox item using vba.  i tried:

for x = 0to sheets("sheet1").listname,listcount - 1
sheets("sheet1").listname.item.select
next x

but it doesnt work

can someone help me?

thanks in dvance,
geebee
Leith Ross - 21 Sep 2007 19:27 GMT
> hi,
>
[quoted text clipped - 10 lines]
> thanks in dvance,
> geebee

Hello Geebee,

When using a Forms type ListBox, you can only select an item either by
clicking, or by changing the value of the Linked Cell. This examples
assumes the Linked Cell is A1, and the list box is named "List Box 1".
It selects the third item in the list.

 With ActiveSheet
   .Range("A1").Value = 3
     With .ListBoxes("List Box 1")
       X = .List(.ListIndex)
     End With
 End With

Sincerely,
Leith Ross
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.