Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 586
Default What is the difference in declaring a Collection in these Procedur

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
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 770
Default What is the difference in declaring a Collection in these Procedur

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" wrote in message
...
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



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,494
Default What is the difference in declaring a Collection in these Procedur

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" wrote in message
...
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
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
declaring Curt Excel Programming 0 May 14th 08 12:04 AM
Declaring a collection as a particular type of object or a particular class Ronald Dodge[_2_] Excel Programming 1 November 16th 07 09:11 AM
How to use Excel VBA program to execute SQL SERVER stored procedur Arron Excel Programming 2 April 2nd 07 06:04 PM
charting a difference of 2 columns' w/o adding a difference column Wab Charts and Charting in Excel 4 July 27th 05 02:37 AM


All times are GMT +1. The time now is 01:12 PM.

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

About Us

"It's about Microsoft Excel"