+ Reply to Thread
Results 1 to 6 of 6

Problem assigning elements in row to array

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

    Problem assigning elements in row to array

    See enclosed file.

    I am trying to assign the contents A1 to I1 to an array but for some reason only the first cell is getting loaded into the array.......any thoughts
    Attached Files Attached Files
    Last edited by welchs101; 11-11-2011 at 08:06 AM.

  2. #2
    Valued Forum Contributor Steffen Thomsen's Avatar
    Join Date
    10-15-2010
    Location
    Kolding, Denmark
    MS-Off Ver
    Excel 2007 and Excel 2010
    Posts
    953

    Re: Problem assigning elements in row to array

    Please Login or Register  to view this content.

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

    Re: Problem assigning elements in row to array

    hi, thanks for the reply but i am looking for code which passes the entire range to the array in one shot.......much faster that way.........but yours does work.

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

    Re: Problem assigning elements in row to array

    i recalled an earlier post on this site.......i think i figured out problem was with the "ubound" statement. I needed to use the correct ubound statement and now it works

    Please Login or Register  to view this content.

  5. #5
    Valued Forum Contributor Steffen Thomsen's Avatar
    Join Date
    10-15-2010
    Location
    Kolding, Denmark
    MS-Off Ver
    Excel 2007 and Excel 2010
    Posts
    953

    Re: Problem assigning elements in row to array

    Then you have to transpose your values first

    Please Login or Register  to view this content.

  6. #6
    Valued Forum Contributor Steffen Thomsen's Avatar
    Join Date
    10-15-2010
    Location
    Kolding, Denmark
    MS-Off Ver
    Excel 2007 and Excel 2010
    Posts
    953

    Re: Problem assigning elements in row to array

    This creates an array with 1 column and 9 rows,

    The other created an array with 9 columns and 1 row

    Therefore you needed to get to your data with

    header_array(1,[1-9])

    Whereas the modified code i just gave you, you can get to the data with

    header_array([1-9])

+ Reply to Thread

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