View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Rob Rob is offline
external usenet poster
 
Posts: 234
Default Collection Function

The Function below fills a Collection with my Products, but when I call the function a second time, I don't want it to have to run. I think I've had a line like this working befo If Not colProducts Is Nothing Then Exit Function
....but when I step through, my collection actually IS nothing when I enter it the second time. Any ideas why?

Thank
Ro

sub testi
msgbox colproducts(1
msgbox colproducts(2
end su

Public Function colProducts() As Collectio
'Don't bother populating if it's already ful
If Not colProducts Is Nothing Then Exit Functio

'Populate the collectio
For i = 1 To 3
colProducts.Add Cells(i, 1).Valu
Nex
End Functio