Need Excel VBA Array Help Problem Accessing Array

  • I have a dynamic array that gets assigned it's values via a 1D range assignment.


    For Debugging purposes I wanted to be able to display elements of the array.

    And I wanted to retrieve two elements (3 and 4, zero based index):

    1. Element(3) if element 3 contains the letters "3P" value I wanted to increase the next array element value by 2

    2. Element(4) increase by 2 if the value existing in element 3

    3. Re-Insert the adjusted element 4 into the array.


    The export data tab shows the 1D array placement into the spreadsheet.


    Could someone show me what I am doing wrong so that I can get access to the array values?


    The code in question is on the Acad Template Tab >> Export Sched Button


    Thanks In Advance

    Tim C.

  • do these little tweaks help at all?


    Code
    1. MsgBox ws.Range("O" & RowToCopy & ":" & "S" & RowToCopy).Address ' doesn't work
    2. MyArray = ws.Range("O" & RowToCopy & ":" & "S" & RowToCopy).Value
    3. Debug.Print MyArray(1,1)
    4. MsgBox "LBound: " & LBound(MyArray) & " UBound: " & UBound(Myarray)