View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Todd huttenstine Todd huttenstine is offline
external usenet poster
 
Posts: 260
Default Count number of selected item in Listbox

This is a followup to my original post:

I came up with the following code...

Dim Counter As Long
Counter = 0
With ListBox1
For i = 0 To .ListCount - 1
ListValue = .List(i)
If .Selected(i) = True Then
Counter = Counter + 1
End If
Next
MsgBox Counter
End With

Can anyone tell me if there is a more effecient way of
doing this?


Thanks
Todd Huttenstine




-----Original Message-----
Hey guys what is the code to count the number of selected
items in a listbox. I know how to count the total number
of items in a listbox but how do you count the total
number of items that are selected?


Thank you
Todd Huttenstine
.