<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Array into Array or Collection? in VBA Forum</title>
    <link>https://forums.autodesk.com/t5/vba-forum/array-into-array-or-collection/m-p/2041820#M23922</link>
    <description>Thanks MP, it's working well for me.</description>
    <pubDate>Mon, 13 Aug 2007 17:27:01 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2007-08-13T17:27:01Z</dc:date>
    <item>
      <title>Array into Array or Collection?</title>
      <link>https://forums.autodesk.com/t5/vba-forum/array-into-array-or-collection/m-p/2041812#M23914</link>
      <description>I've been brainstorming on my little project that has to do with making some sort of automated BOM. One problem I ran into is how can I combine arrays? &lt;BR /&gt;
Here's what I mean:&lt;BR /&gt;
I prompt users to select a detail (1 detail), I get data from all the parts and build an array, then I could dump it into the BOM form, but I don't want to, I want to store it somehow, then they can select another detail and I store that array, as many details as they want. Then I would complie it all and finnally dump it into excel.&lt;BR /&gt;
Any ideas?&lt;BR /&gt;
I'm doing research on collections, not sure how they can be beneficial yet though.&lt;BR /&gt;
I will also have a dropdown with a name of each detail extracted and when they select one I want to be able to bring that array back up into the list.&lt;BR /&gt;
&lt;BR /&gt;
Any ideas are welcome.&lt;BR /&gt;
Thanks,&lt;BR /&gt;
Viktor.</description>
      <pubDate>Fri, 10 Aug 2007 00:27:34 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/array-into-array-or-collection/m-p/2041812#M23914</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2007-08-10T00:27:34Z</dc:date>
    </item>
    <item>
      <title>Re: Array into Array or Collection?</title>
      <link>https://forums.autodesk.com/t5/vba-forum/array-into-array-or-collection/m-p/2041813#M23915</link>
      <description>no idea what your array holds but you could just put it in another array or &lt;BR /&gt;
a collection&lt;BR /&gt;
&lt;BR /&gt;
if you have a usable array of some data&lt;BR /&gt;
a1&lt;BR /&gt;
and you just want to continue collecting other similar arrays&lt;BR /&gt;
&lt;BR /&gt;
While Not Done&lt;BR /&gt;
    GetNextArray a1&lt;BR /&gt;
    Redim Preserve bigArray(ubound(bigArray)+1)&lt;BR /&gt;
    bigArray(ubound(bigArray) = a1&lt;BR /&gt;
&lt;BR /&gt;
   If condition to end loop Then Done = True&lt;BR /&gt;
Loop&lt;BR /&gt;
&lt;BR /&gt;
or add them to a collection&lt;BR /&gt;
While Not Done&lt;BR /&gt;
    GetNextArray a1&lt;BR /&gt;
    colArrays.Add a1&lt;BR /&gt;
   If condition to end loop Then Done = True&lt;BR /&gt;
Loop&lt;BR /&gt;
&lt;BR /&gt;
when you're done&lt;BR /&gt;
    For Each vArray in BigArray&lt;BR /&gt;
        Doarray vArray&lt;BR /&gt;
or&lt;BR /&gt;
    For Each vArray in colArrays&lt;BR /&gt;
        Doarray vArray&lt;BR /&gt;
&lt;BR /&gt;
but then that's so obvious maybe i'm not really understanding your question?&lt;BR /&gt;
&lt;BR /&gt;
hth&lt;BR /&gt;
Mark&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
&lt;VIK07&gt; wrote in message news:5685892@discussion.autodesk.com...&lt;BR /&gt;
I've been brainstorming on my little project that has to do with making some &lt;BR /&gt;
sort of automated BOM. One problem I ran into is how can I combine arrays?&lt;BR /&gt;
Here's what I mean:&lt;BR /&gt;
I prompt users to select a detail (1 detail), I get data from all the parts &lt;BR /&gt;
and build an array, then I could dump it into the BOM form, but I don't want &lt;BR /&gt;
to, I want to store it somehow, then they can select another detail and I &lt;BR /&gt;
store that array, as many details as they want. Then I would complie it all &lt;BR /&gt;
and finnally dump it into excel.&lt;BR /&gt;
Any ideas?&lt;BR /&gt;
I'm doing research on collections, not sure how they can be beneficial yet &lt;BR /&gt;
though.&lt;BR /&gt;
I will also have a dropdown with a name of each detail extracted and when &lt;BR /&gt;
they select one I want to be able to bring that array back up into the list.&lt;BR /&gt;
&lt;BR /&gt;
Any ideas are welcome.&lt;BR /&gt;
Thanks,&lt;BR /&gt;
Viktor.&lt;/VIK07&gt;</description>
      <pubDate>Fri, 10 Aug 2007 01:00:43 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/array-into-array-or-collection/m-p/2041813#M23915</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2007-08-10T01:00:43Z</dc:date>
    </item>
    <item>
      <title>Re: Array into Array or Collection?</title>
      <link>https://forums.autodesk.com/t5/vba-forum/array-into-array-or-collection/m-p/2041814#M23916</link>
      <description>Vik07 wrote:&lt;BR /&gt;
&amp;gt; I've been brainstorming on my little project that has to do with making some sort of automated BOM. One problem I ran into is how can I combine arrays? &lt;BR /&gt;
&amp;gt; Here's what I mean:&lt;BR /&gt;
&amp;gt; I prompt users to select a detail (1 detail), I get data from all the parts and build an array, then I could dump it into the BOM form, but I don't want to, I want to store it somehow, then they can select another detail and I store that array, as many details as they want. Then I would complie it all and finnally dump it into excel.&lt;BR /&gt;
&amp;gt; Any ideas?&lt;BR /&gt;
&amp;gt; I'm doing research on collections, not sure how they can be beneficial yet though.&lt;BR /&gt;
&amp;gt; I will also have a dropdown with a name of each detail extracted and when they select one I want to be able to bring that array back up into the list.&lt;BR /&gt;
&amp;gt; &lt;BR /&gt;
&amp;gt; Any ideas are welcome.&lt;BR /&gt;
&amp;gt; Thanks,&lt;BR /&gt;
&amp;gt; Viktor.&lt;BR /&gt;
&lt;BR /&gt;
Not sure if it's what you need but you might want to check out Scripting &lt;BR /&gt;
Dictionaries. I've been told on here (by Tony Tanzillo?) that they're &lt;BR /&gt;
faster. There's a few examples in this NG. Don't forget to reference the &lt;BR /&gt;
Microsoft Scripting Runtime in your project.&lt;BR /&gt;
&lt;BR /&gt;
Dave F.</description>
      <pubDate>Fri, 10 Aug 2007 08:30:04 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/array-into-array-or-collection/m-p/2041814#M23916</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2007-08-10T08:30:04Z</dc:date>
    </item>
    <item>
      <title>Re: Array into Array or Collection?</title>
      <link>https://forums.autodesk.com/t5/vba-forum/array-into-array-or-collection/m-p/2041815#M23917</link>
      <description>Thanks for pointers guys. Here's a little analogy of what I'd like to do:&lt;BR /&gt;
Kind of like creating a book, you take a piece of paper (array) and you write a whole bunch of stuff on it, then you paste it unto a page. Use the next piece of paper and put it unto the next page. Then when you're done you can go thru the pages, one by one.&lt;BR /&gt;
One other way I was thinking is writing it to a temp database. not sure though.</description>
      <pubDate>Fri, 10 Aug 2007 16:42:55 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/array-into-array-or-collection/m-p/2041815#M23917</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2007-08-10T16:42:55Z</dc:date>
    </item>
    <item>
      <title>Re: Array into Array or Collection?</title>
      <link>https://forums.autodesk.com/t5/vba-forum/array-into-array-or-collection/m-p/2041816#M23918</link>
      <description>MP could you elaborate a bit more on this section:&lt;BR /&gt;
&lt;BR /&gt;
or add them to a collection&lt;BR /&gt;
While Not Done&lt;BR /&gt;
GetNextArray a1&lt;BR /&gt;
colArrays.Add a1&lt;BR /&gt;
If condition to end loop Then Done = True&lt;BR /&gt;
Loop</description>
      <pubDate>Fri, 10 Aug 2007 17:14:59 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/array-into-array-or-collection/m-p/2041816#M23918</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2007-08-10T17:14:59Z</dc:date>
    </item>
    <item>
      <title>Re: Array into Array or Collection?</title>
      <link>https://forums.autodesk.com/t5/vba-forum/array-into-array-or-collection/m-p/2041817#M23919</link>
      <description>Per you op&lt;BR /&gt;
" I get data from all the parts and build an array"&lt;BR /&gt;
my example assumes you have a sub to perform this service&lt;BR /&gt;
the arg to the sub is a byref variable a1&lt;BR /&gt;
Sub GetNextArray (ByRef a1 as Variant)&lt;BR /&gt;
    a1 = getdatafromparts 'however you're doing that&lt;BR /&gt;
End Sub&lt;BR /&gt;
...so now a1 is your array of data&lt;BR /&gt;
&lt;BR /&gt;
you said you wanted to continue collecting multiple arrays before "using" &lt;BR /&gt;
them&lt;BR /&gt;
so a loop is required, &lt;GET each="" array=""&gt;&lt;BR /&gt;
&lt;BR /&gt;
colArrays.Add a1&lt;BR /&gt;
adds the array to a collection&lt;BR /&gt;
&lt;BR /&gt;
the loop continues til you're "done" collecting&lt;BR /&gt;
If &lt;CONDITION to="" end="" loop=""&gt; Then Done = True&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
&lt;CONDITION to="" end="" loop=""&gt; ' is whatever signal you create to tell you're done &lt;BR /&gt;
collecting data&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
after the loop is done, the collection holds all your arrays&lt;BR /&gt;
 then you can call a sub that consumes that collection of arrays of data&lt;BR /&gt;
Call UseCollectionOfArrays (colArrays)&lt;BR /&gt;
&lt;BR /&gt;
that sub would loop through all collection items and process them &lt;BR /&gt;
accordingly&lt;BR /&gt;
&lt;BR /&gt;
hth&lt;BR /&gt;
Mark&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
&lt;VIK07&gt; wrote in message news:5686675@discussion.autodesk.com...&lt;BR /&gt;
MP could you elaborate a bit more on this section:&lt;BR /&gt;
&lt;BR /&gt;
or add them to a collection&lt;BR /&gt;
While Not Done&lt;BR /&gt;
GetNextArray a1&lt;BR /&gt;
colArrays.Add a1&lt;BR /&gt;
If condition to end loop Then Done = True&lt;BR /&gt;
Loop&lt;/VIK07&gt;&lt;/CONDITION&gt;&lt;/CONDITION&gt;&lt;/GET&gt;</description>
      <pubDate>Mon, 13 Aug 2007 16:27:04 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/array-into-array-or-collection/m-p/2041817#M23919</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2007-08-13T16:27:04Z</dc:date>
    </item>
    <item>
      <title>Re: Array into Array or Collection?</title>
      <link>https://forums.autodesk.com/t5/vba-forum/array-into-array-or-collection/m-p/2041818#M23920</link>
      <description>see if this will help.&lt;BR /&gt;
&lt;BR /&gt;
Public Bom_Items() As Variant&lt;BR /&gt;
&lt;BR /&gt;
Public Sub BOM_Array(sPcmark As String, sDesc As String, dLength As Double, dWidth As Double)&lt;BR /&gt;
    Dim Items(3) As Variant&lt;BR /&gt;
    &lt;BR /&gt;
    Items(0) = "PcMark"&lt;BR /&gt;
    Items(1) = "sDesc"&lt;BR /&gt;
    Items(2) = dLength&lt;BR /&gt;
    Items(3) = dWidth&lt;BR /&gt;
    &lt;BR /&gt;
    ReDim Preserve Bom_Items(UBound(Bom_Items) + 1)&lt;BR /&gt;
    Bom_Items(UBound(Bom_Items)) = Items&lt;BR /&gt;
    Bom_Items(0) = UBound(Bom_Items) - 1&lt;BR /&gt;
    &lt;BR /&gt;
End Sub&lt;BR /&gt;
&lt;BR /&gt;
Public Sub Bom_Test()&lt;BR /&gt;
    ReDim Bom_Items(0)&lt;BR /&gt;
    &lt;BR /&gt;
    Call BOM_Array("pc1", "desc1", 1, 1)&lt;BR /&gt;
    Call BOM_Array("pc2", "desc2", 2, 2)&lt;BR /&gt;
    Call BOM_Array("pc3", "desc3", 3, 3)&lt;BR /&gt;
    Call BOM_Array("pc4", "desc4", 4, 4)&lt;BR /&gt;
End Sub</description>
      <pubDate>Mon, 13 Aug 2007 16:59:03 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/array-into-array-or-collection/m-p/2041818#M23920</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2007-08-13T16:59:03Z</dc:date>
    </item>
    <item>
      <title>Re: Array into Array or Collection?</title>
      <link>https://forums.autodesk.com/t5/vba-forum/array-into-array-or-collection/m-p/2041819#M23921</link>
      <description>see if this will help.&lt;BR /&gt;
&lt;BR /&gt;
Public Bom_Items() As Variant&lt;BR /&gt;
&lt;BR /&gt;
Public Sub BOM_Array(sPcmark As String, sDesc As String, dLength As Double, dWidth As Double)&lt;BR /&gt;
    Dim Items(3) As Variant&lt;BR /&gt;
    &lt;BR /&gt;
    Items(0) = "PcMark"&lt;BR /&gt;
    Items(1) = "sDesc"&lt;BR /&gt;
    Items(2) = dLength&lt;BR /&gt;
    Items(3) = dWidth&lt;BR /&gt;
    &lt;BR /&gt;
    ReDim Preserve Bom_Items(UBound(Bom_Items) + 1)&lt;BR /&gt;
    Bom_Items(UBound(Bom_Items)) = Items&lt;BR /&gt;
    Bom_Items(0) = UBound(Bom_Items) - 1&lt;BR /&gt;
    &lt;BR /&gt;
End Sub&lt;BR /&gt;
&lt;BR /&gt;
Public Sub Bom_Test()&lt;BR /&gt;
    ReDim Bom_Items(0)&lt;BR /&gt;
    &lt;BR /&gt;
    Call BOM_Array("pc1", "desc1", 1, 1)&lt;BR /&gt;
    Call BOM_Array("pc2", "desc2", 2, 2)&lt;BR /&gt;
    Call BOM_Array("pc3", "desc3", 3, 3)&lt;BR /&gt;
    Call BOM_Array("pc4", "desc4", 4, 4)&lt;BR /&gt;
End Sub</description>
      <pubDate>Mon, 13 Aug 2007 16:59:15 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/array-into-array-or-collection/m-p/2041819#M23921</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2007-08-13T16:59:15Z</dc:date>
    </item>
    <item>
      <title>Re: Array into Array or Collection?</title>
      <link>https://forums.autodesk.com/t5/vba-forum/array-into-array-or-collection/m-p/2041820#M23922</link>
      <description>Thanks MP, it's working well for me.</description>
      <pubDate>Mon, 13 Aug 2007 17:27:01 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/array-into-array-or-collection/m-p/2041820#M23922</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2007-08-13T17:27:01Z</dc:date>
    </item>
    <item>
      <title>Re: Array into Array or Collection?</title>
      <link>https://forums.autodesk.com/t5/vba-forum/array-into-array-or-collection/m-p/2041821#M23923</link>
      <description>Great,&lt;BR /&gt;
glad to help&lt;BR /&gt;
Mark&lt;BR /&gt;
&lt;VIK07&gt; wrote in message news:5688199@discussion.autodesk.com...&lt;BR /&gt;
Thanks MP, it's working well for me.&lt;/VIK07&gt;</description>
      <pubDate>Mon, 13 Aug 2007 19:27:37 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/array-into-array-or-collection/m-p/2041821#M23923</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2007-08-13T19:27:37Z</dc:date>
    </item>
    <item>
      <title>Re: Array into Array or Collection?</title>
      <link>https://forums.autodesk.com/t5/vba-forum/array-into-array-or-collection/m-p/2041822#M23924</link>
      <description>Hey, wowens9, this works like a charm&lt;BR /&gt;
Nice trick,&lt;BR /&gt;
Regards,&lt;BR /&gt;
&lt;BR /&gt;
~'J'~</description>
      <pubDate>Mon, 13 Aug 2007 20:22:44 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/array-into-array-or-collection/m-p/2041822#M23924</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2007-08-13T20:22:44Z</dc:date>
    </item>
  </channel>
</rss>

