I have an array like this:
Dim aFirstArray() As Variant
How do I clear the entire array? What about a collection?
Find a better use for myself: I usually test if a variant is empty, and all of the above methods fail with the test. I found that you can actually set a variant to empty:
Dim aTable As Variant
If IsEmpty(aTable) Then
'This is true
End If
ReDim aTable(2)
If IsEmpty(aTable) Then
'This is False
End If
ReDim aTable(2)
aTable = Empty
If IsEmpty(aTable) Then
'This is true
End If
ReDim aTable(2)
Erase aTable
If IsEmpty(aTable) Then
'This is False
End If
this way i get the behaviour i want