LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,939
Default Collections problem

You are doing early binding which is a very bad idea. Check out the link
provided. What you wnat to do is late binding...

dim col1 as collection

set col1 = new collection

http://www.cpearson.com/excel/variables.htm
Look at "Don't Use The New Keyword In A Dim Statement"

--
HTH...

Jim Thomlinson


"John" wrote:

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



 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Collections of Collections David Morton Excel Programming 6 November 13th 04 01:10 AM
Problem with Worksheet collections... :( abxy[_62_] Excel Programming 4 May 11th 04 09:18 PM
Help with collections ksnapp[_45_] Excel Programming 1 April 7th 04 12:42 AM
Clearing Collections Tommy T Excel Programming 0 February 4th 04 05:51 PM
Using Collections Kerry[_4_] Excel Programming 1 January 25th 04 04:08 PM


All times are GMT +1. The time now is 11:37 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"