AnsweredAssumed Answered

HELP - Collect data from table into array

Question asked by james demarco on Dec 20, 2018
Latest reply on Dec 20, 2018 by Fifi Riri

First let me be clear - I have not written VBA since 1998!

I am attempting to pull two rows for a revision table, to copy and paste into a new revision table. 

Using a count I am gathering the data - my thinking was it would create an array - but I cannot figure out to get the data back out an into a table (BTW I cannot believe how difficult tables are in SW).

So I have this:

For i = 0 To sCount - 2

        sRowStr = ""

        For j = 0 To swTable.RowCount + 3

             sRowStr = sRowStr & "," & swTable.Text(i, j)

             myArray = sRowStr & "," & swTable.Text(i, j)

        Next j

        'collects the text for the 2 revsions

        'If i = 0 Then sRev1 = " " & sRowStr & " "

        'If i = 1 Then sRev2 = "  " & sRowStr & " "

        If i = 0 Then myArray2 = myArray

        'Debug.Print sRev1

        'Debug.Print sRev2

        Debug.Print myArray

        Debug.Print myArray2

    Next I

This is working and it captures the data, I am able to replace the table with a new one - BUT I cannot figure out how to get my data into the new table.  I was thinking that both of these were an array (I now realize I have some redundancy) I thought I could select the data by its postion in the array.

I do not believe what I am doing is difficult - I think it is more a matter that I do not know what I am doing.

Any help would be greatly appreciated.

Thank you.

BTW when this is all complete I will share it on here - it is replacing sheet formats and revision table to make use of the new PDM revision tool.

 

Here is the data collected as displayed in immediate: (zone cell is blank on this drawing)

,,10/18/2017,PBF,MTL,,ISSUE,A,A

,,1/10/2018,PCO,MTL,E11259,ADDED (4) .344 HOLES,B,B

Outcomes