Results 1 to 6 of 6

Somehow turned 1-dimensional array into 2D array .....dont know how

Threaded View

  1. #1
    Forum Contributor
    Join Date
    12-01-2007
    Location
    USA-North Carolina
    MS-Off Ver
    MS Office 2016
    Posts
    2,712

    Somehow turned 1-dimensional array into 2D array .....dont know how

    Question:
    I have this 1D array that after i "sort" it using my own sort function the array comes back as 2D. Now how do i know it comes back as 2D.

    If i dont do my special sort function i can reference the array as "array_file1(x)" where x is variable.

    If i do my special sort function i MUST reference the array as "array_file1(x,1)" where x is variable.


    I am enclosing the part of my code that does the sort and does the initializing of the arrays.........



    Now in my sort i paste the array into the worksheet and then do the sort then read the worksheet into array. So my guess is reading the worksheet data inot the array is somehow causing this change.........but i dont understand why. Her eis the command i use to store the values into the array from the worksheet

    'store alphabetized list into array
    file_array1 = ws_macro.Range("K1:K" & UBound(file_array1)).Value


    so my question is why does my array go from 1d to 2d and what command do i need to change to keep it 1d. its not that the 2d is bad its just that this was unexpected and took me a little while to figure out.
    Attached Files Attached Files

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1