View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
Tom Ogilvy Tom Ogilvy is offline
external usenet poster
 
Posts: 27,285
Default Reset New Collection

Sub AAA()

Dim cTraders As New Collection

On Error Resume Next
For Each rCell In Range(Cells(65536, 1).End(xlUp), Cells(2, 1))
cTraders.Add rCell.Value, rCell.Value
Next rCell
On Error GoTo 0
Debug.Print cTraders.Count
For i = 1 To cTraders.Count
cTraders.Remove cTraders.Item(1)
Next
Debug.Print cTraders.Count
End Sub

--
Regards,
Tom Ogilvy


"Tony Di Stasi" wrote in message
...
Created a collection and will need to reset it to zero
once it has been compiled so that it can be compiled with
other data.

Dim cTraders As New Collection

On Error Resume Next
For Each rCell In Range(Cells(65536, 1).End(xlUp), Cells
(2, 1))
cTraders.Add rCell.Value, rCell.Value
Next rCell
On Error GoTo 0

I need a line here to reset the collection to zero so that
when i move on the next worksheet the collection will be
different. Thanks!!