Hi guys, i'm working on a project right now that requires deletion of unchecked items in Listview. I already have a working code but I guess this is not efficient if the number of items is 10,000+ or more. Here is my code:
Code:recount: For i = 1 To lvRecords.ListItems.Count If Not lvRecords.ListItems(i).Checked Then lvRecords.ListItems.Remove i GoTo recount End If Next
I also have working code that counts/identify if the item is checked, however like my issue above this may take time if the records i'm processing is more than 10,000. Here is my code:
Code:For i = 0 To lvRecords.ListItems.Count - 1 If lvRecords.ListItems(i + 1).Checked Then countChecked = countChecked + 1 End If Next
Is there any other efficient code than what i posted above that will provide the same functionality and results? Thanks in advance.




Reply With Quote
