Mega Code Archive

 
Categories / VisualBasic Script / Data Type
 

Remove element with the key

Sub AccessCollection()     Dim colNames As Collection     Set colNames = New Collection     colNames.Add "A", "A"     colNames.Add "Dan", "Dan"     colNames.Add "Al", "Ale"     colNames.Add "B", "Bre"     colNames.Add "S", "So"     colNames.Add "Sue", "Su"     colNames.Remove "Sonia"     Debug.Print colNames(1)     Debug.Print colNames.Item(1)     Debug.Print colNames("Alexis") End Sub