-
ListView
There is a ListBox with several Items.
I need to Delete all ListItems Text = "*"
I try with following code
Code:
Private Sub RemoveReservedPalletFromLV()
Dim l As Long
Dim li As MSComctlLib.ListItem
For Each li In lv.ListItems
If li.Text = "*" Then
lv.ListItems.Remove (li.Index)
End If
Next
End Sub
This pice of code gives an error
"control collection has been modified"
Can any one help me
Thank u in Advance
Dinesh
-
I think you are looking for something like this..
Code:
Private Sub RemoveReservedPalletFromLV()
Dim i&
i = 1
While i < lvw.ListItems.Count
If lvw.ListItems(i).Text = "*" Then
lvw.ListItems.Remove i
Else
i = i + 1
End If
Wend
End Sub