Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 190
Default select listbox item

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

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 128
Default select listbox item

On Sep 21, 9:54 am, geebee (noSPAMs) wrote:
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


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

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
Remove Item from Listbox by Item Name Randy[_2_] Excel Programming 3 September 19th 07 02:36 PM
Double click item in Listbox to select item and close Listbox GusEvans Excel Programming 3 July 19th 07 12:36 PM
ListBox3.ListIndex = ListBox3.ListCount -- How to select the last item in a Listbox? [email protected] Excel Programming 2 March 8th 07 01:14 AM
select listbox item automatically ilyaskazi[_71_] Excel Programming 3 September 14th 05 12:27 PM
Select an item in a listbox using code Fred Jacobowitz Excel Programming 2 August 23rd 04 03:27 AM


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

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"