+ Reply to Thread
Results 1 to 3 of 3

Populating array from Cell data

  1. #1
    Registered User
    Join Date
    09-23-2010
    Location
    Australia
    MS-Off Ver
    Excel 2003
    Posts
    47

    Populating array from Cell data

    Hey ive tried and tried to get this to work and im sure its something simple ive missed but can anyone tell me why i get an error (runtime error: 9. Subscruipt out of range) when i try and run this code?

    Please Login or Register  to view this content.
    the error occurs on this line:
    Please Login or Register  to view this content.
    any help would be greatly appreciated
    Last edited by Aussiexile; 04-12-2011 at 05:58 PM. Reason: solved

  2. #2
    Valued Forum Contributor
    Join Date
    09-21-2003
    Location
    British Columbia , Canada
    MS-Off Ver
    03,07,10,13
    Posts
    727

    Re: Populating array from Cell data

    Change ReDim DocArray(1 To 100) To ReDim DocArray(0 To 100) ... you've indicated that the array is from 1 to 100 and then you don't set the "ArrayTotal" = 1 until after the first assignment to the Array ... so it fails

    So either change the Redim OR incrment "ArrayTotal" just above the Array(ArrayTotal) = test

  3. #3
    Registered User
    Join Date
    09-23-2010
    Location
    Australia
    MS-Off Ver
    Excel 2003
    Posts
    47

    Re: Populating array from Cell data

    Well dont i feel just a little bit sheepish. such a small thing to have over looked.

    *headdesk*

+ 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