I have a collection object in vba where I am adding a bunch of ID values
Dim newCollection As New Collection
newCollection.ADD Me.ID
Is there a way for me to delete an ID from the collection without knowing what key it is stored as?
I tried to do:
newCollection.Remove """" & Me.ID & """"
But I get:
Invalid Procedure Call or Argument
In this case you are trying to remove the contents of Me.ID as a string. What you need to do is identify what the position of your ID is and then remove it. You can do this as follows:
You need (want) to ALSO add the "key" to lookup the value (it must be a string).
The following code shows how this works:
Output: