PC Review


Reply
Thread Tools Rate Thread

What is the difference in declaring a Collection in these Procedur

 
 
RyanH
Guest
Posts: n/a
 
      26th Sep 2008
Can someone tell me the difference in these two subs, if any difference at
all?

Sub BuildCollections()

Dim colAssignedDepts As Collection

Set colAssignedDepts = New Collection
With colAssignedDepts
.Add chkEngineering
.Add chkGraphProd
' add other checkboxes
End With
End Sub

Sub BuildCollections()

Dim colAssignedDepts As New Collection

With colAssignedDepts
.Add chkEngineering
.Add chkGraphProd
' add other checkboxes
End With
End Sub
--
Cheers,
Ryan
 
Reply With Quote
 
 
 
 
Doug Glancy
Guest
Posts: n/a
 
      26th Sep 2008
Ryan,

If you google things like ' "as new collection" "as collection" including:

http://discuss.fogcreek.com/joelonso...w&ixPost=24747

http://groups.google.com/groups?q=%2...L_enUS250US250

http://www.dailydoseofexcel.com/arch...ult-instances/

hth,

Doug

"RyanH" <(E-Mail Removed)> wrote in message
news:B76F1E22-740B-4ABF-B8A1-(E-Mail Removed)...
> Can someone tell me the difference in these two subs, if any difference at
> all?
>
> Sub BuildCollections()
>
> Dim colAssignedDepts As Collection
>
> Set colAssignedDepts = New Collection
> With colAssignedDepts
> .Add chkEngineering
> .Add chkGraphProd
> ' add other checkboxes
> End With
> End Sub
>
> Sub BuildCollections()
>
> Dim colAssignedDepts As New Collection
>
> With colAssignedDepts
> .Add chkEngineering
> .Add chkGraphProd
> ' add other checkboxes
> End With
> End Sub
> --
> Cheers,
> Ryan



 
Reply With Quote
 
Gary Keramidas
Guest
Posts: n/a
 
      26th Sep 2008
check out chip pearson's site
Don't Use The New Keyword In A Dim Statement
http://www.cpearson.com/Excel/variables.htm

--


Gary


"RyanH" <(E-Mail Removed)> wrote in message
news:B76F1E22-740B-4ABF-B8A1-(E-Mail Removed)...
> Can someone tell me the difference in these two subs, if any difference at
> all?
>
> Sub BuildCollections()
>
> Dim colAssignedDepts As Collection
>
> Set colAssignedDepts = New Collection
> With colAssignedDepts
> .Add chkEngineering
> .Add chkGraphProd
> ' add other checkboxes
> End With
> End Sub
>
> Sub BuildCollections()
>
> Dim colAssignedDepts As New Collection
>
> With colAssignedDepts
> .Add chkEngineering
> .Add chkGraphProd
> ' add other checkboxes
> End With
> End Sub
> --
> Cheers,
> Ryan



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
What is the difference between Collection and List? Leon_Amirreza Microsoft Dot NET Framework 1 1st Mar 2009 09:44 PM
Declaring a collection as a particular type of object or a particular class Ronald Dodge Microsoft Excel Programming 1 16th Nov 2007 09:11 AM
What is the difference between Collection<T> and List<T> ? Oleg Subachev Microsoft C# .NET 3 7th Aug 2007 02:56 PM
Difference between a collection and arraylist? AppleBag Microsoft Dot NET 3 29th Nov 2006 10:08 PM
difference of ArrayList and collection? Hei Microsoft VB .NET 12 24th Dec 2003 02:46 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 08:54 PM.