View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Bob Phillips[_6_] Bob Phillips[_6_] is offline
external usenet poster
 
Posts: 11,272
Default Items in a Listbox

"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