View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
Doug Glancy Doug Glancy is offline
external usenet poster
 
Posts: 770
Default listbox remove Item

Simon,

Sub Test()

Dim i As Long

With Me.myListBox
For i = .ListCount - 1 To 0 Step -1
If .Selected(i) = True Then
.RemoveItem i
End If
Next i
End With

End Sub


"Simon Shaw" <simonATsimonstoolsDOTcom wrote in message
...
I am trying to remove multiple selected items from a ListBox... the code:

myListBox.RemoveItem myListBox.ListIndex

only removes the last selected item. I have tried a number of things, but
keep getting bad results. Does anyone have an example of this?

Thanks

Simon Shaw