Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
How about simply:
If bCondition1 = True Then Dim coll1 as Collection Set coll1 = New Collection End If If bCondition2 = True Then Dim coll2 as Collection Set coll2 = New Collection End If etc. RBS "John" wrote in message ... Hi there, I'm trying to create a variable number (between 1 and 4) of collections, but I don't know what that number will be in advance. Is there a way of creating (and declaring) collections at runtime? So far my solution has been to declare four collections at the beginning of the code ie Dim col1 As New Collection Dim col2 ..... and then setting the unwanted ones to Nothing once the requirement can be counted, however this seems a bit wasteful. Any guidance? Best regards John |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi RB,
Yes that would work too. I wasn't aware of the early binding problem, so will use this, thanks. Best regards John "RB Smissaert" wrote in message ... How about simply: If bCondition1 = True Then Dim coll1 as Collection Set coll1 = New Collection End If If bCondition2 = True Then Dim coll2 as Collection Set coll2 = New Collection End If etc. RBS "John" wrote in message ... Hi there, I'm trying to create a variable number (between 1 and 4) of collections, but I don't know what that number will be in advance. Is there a way of creating (and declaring) collections at runtime? So far my solution has been to declare four collections at the beginning of the code ie Dim col1 As New Collection Dim col2 ..... and then setting the unwanted ones to Nothing once the requirement can be counted, however this seems a bit wasteful. Any guidance? Best regards John |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Collections problem | Excel Programming | |||
Collections of Collections | Excel Programming | |||
Problem with Worksheet collections... :( | Excel Programming | |||
Help with collections | Excel Programming | |||
Using Collections | Excel Programming |