+ Reply to Thread
Results 1 to 2 of 2

Reading range into static array

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

    Reading range into static array

    I am enclosing a file for reference.

    I have a static array that is 377 elements. I am trying to read in 377 cells from sheet1 col-A into the array but i get an error. Not sure whats wrong. Can someone help?
    Attached Files Attached Files

  2. #2
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: Reading range into static array

    To assign the Range to the Array in one go you would need to make the Array of Variant Type (it would be 2 dimensional at that point unless you were to Transpose the Range)

    Please Login or Register  to view this content.
    the above would be (1 to n, 1 to 1) to remove 2nd dimension you would transpose the Range as mentioned previously (for a vertical vector 1 transpose, for horizontal vector 2)

    Please Login or Register  to view this content.
    If you want to keep the Array of String type you would be obliged to iterate the Range and populate the Array on an item by item basis.

+ 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