Add only unique items to a listbox (no duplicates added). Fast and short without any loops.
Use this method to avoid adding an item to a ListBox that already exists. It's a lot faster and shorter than submissions that uses loops etc.
AI
AI Summary: This codebase represents a historical implementation of the logic described in the metadata. Our preservation engine analyzes the structure to provide context for modern developers.
Source Code
Private Sub AddUnique(StringToAdd As String, lst As ListBox)
lst.Text = StringToAdd
If lst.ListIndex = -1 Then
'it does not exist, so add it..
lst.AddItem StringToAdd
End If
End Sub
Original Comments (3)
Recovered from Wayback Machine