Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
delete element is collection
how would i remove all elements from a variable set as new collection?
erase expects an array. -- Gary |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
delete element is collection
Set your collection to nothing and then re-create it...
Dim col As Collection Set col = New Collection col.Add Sheet1, Sheet1.Name col.Add Sheet2, Sheet2.Name col.Add Sheet3, Sheet3.Name MsgBox col.Item(Sheet2.Name).Name Set col = Nothing Set col = New Collection -- HTH... Jim Thomlinson "Gary Keramidas" wrote: how would i remove all elements from a variable set as new collection? erase expects an array. -- Gary |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
delete element is collection
thanks jim, works for me. -- Gary "Jim Thomlinson" wrote in message ... Set your collection to nothing and then re-create it... Dim col As Collection Set col = New Collection col.Add Sheet1, Sheet1.Name col.Add Sheet2, Sheet2.Name col.Add Sheet3, Sheet3.Name MsgBox col.Item(Sheet2.Name).Name Set col = Nothing Set col = New Collection -- HTH... Jim Thomlinson "Gary Keramidas" wrote: how would i remove all elements from a variable set as new collection? erase expects an array. -- Gary |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
delete element is collection
Set the collection variable to Nothing. E.g.,
Set MyCollection = Nothing -- Cordially, Chip Pearson Microsoft MVP - Excel, 10 Years Pearson Software Consulting www.cpearson.com (email on the web site) "Gary Keramidas" <GKeramidasATmsn.com wrote in message ... how would i remove all elements from a variable set as new collection? erase expects an array. -- Gary |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Delete worksheet in collection | Excel Programming | |||
VBA- Contains any element | Excel Programming | |||
Delete String Element | Excel Programming | |||
Delete rows with common element | Excel Programming |