Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hey guys
I have a Listbox named Listbox1 on sheet "Wkly Renewals". I have the liststyle property set to Option and the multiselect property set to Multi so multiple items can be selected at once. The listbox contains 6 values. Below are the values listed in order in which they are listed in the listbox: Jan Week1 Jan Week2 Jan Week3 Jan Week4 Jan Week5 Jan MTD I have not worked with listboxes very much and do not know how to programmatically select an item or items. How would I do the following with code? 1) Select Jan Week2 as well Jan MTD? 2) For each item selected in the listbox, display a msgbox of the item 3) For every item in the listbox(regardless if its selected or not), display a msgbox of the item Thank you Todd Huttenstine |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
"Todd Huttenstine" wrote in message
... Hey guys 1) Select Jan Week2 as well Jan MTD? Dim i With ActiveSheet.ListBox1 .Selected(1) = True .Selected(5) = True End With 2) For each item selected in the listbox, display a msgbox of the item Dim i With ActiveSheet.ListBox1 For i = 0 To .ListCount - 1 If .Selected(i) Then MsgBox .List(i) End If Next i End With 3) For every item in the listbox(regardless if its selected or not), display a msgbox of the item Dim i With ActiveSheet.ListBox1 For i = 0 To .ListCount - 1 MsgBox .List(i) Next i End With |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Fill a ListBox with items using VBA | Excel Programming | |||
Listbox--moving items up or down | Excel Programming | |||
listing items from listbox | Excel Programming | |||
Counting items in a listbox | Excel Programming | |||
Checking Listbox Items | Excel Programming |