+ Reply to Thread
Results 1 to 6 of 6

Subscript out of range - Array empty

  1. #1
    Registered User
    Join Date
    07-02-2013
    Location
    Seattle, WA
    MS-Off Ver
    Excel 2007
    Posts
    93

    Subscript out of range - Array empty

    Hello all!

    I've attached a sample of my workbook. What I'm trying to accomplish is that on Sheet2 there is a list that I need to find in Sheet1 and then copy all rows associated with this entry. In this case the code is supposed to find the first item (100000) and then copy the row it is in as well as the following 6 and paste to a new sheet. Then do it for the remaining items in the list. I am getting a "subscript out of range" error and I've found that it is because my array "arr2find" is not storing the list from Sheet2. What am I missing or not understanding?!

    Any help would be appreciated, thank you

    Example.xlsm

  2. #2
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: Subscript out of range - Array empty

    There are two errors on the code.
    I have corrected the first one, but I am not sure if the second correction is right for you (Highlighted in Red)
    Please Login or Register  to view this content.

  3. #3
    Registered User
    Join Date
    07-02-2013
    Location
    Seattle, WA
    MS-Off Ver
    Excel 2007
    Posts
    93

    Re: Subscript out of range - Array empty

    Thanks AB33...it got me past that error, but the offset line is only grabbing the row the number is found on and not the row + the 6 below it. I'll need to work out the pasting part...but is there a way to copy the 7 rows all together?

  4. #4
    Registered User
    Join Date
    07-02-2013
    Location
    Seattle, WA
    MS-Off Ver
    Excel 2007
    Posts
    93

    Re: Subscript out of range - Array empty

    okay, I updated the

    Please Login or Register  to view this content.
    to

    Please Login or Register  to view this content.
    Which allows for the first entry to copy the 7 rows, but the 2nd only takes the row with the next list entry....

  5. #5
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: Subscript out of range - Array empty

    Please Login or Register  to view this content.

  6. #6
    Registered User
    Join Date
    07-02-2013
    Location
    Seattle, WA
    MS-Off Ver
    Excel 2007
    Posts
    93

    Re: Subscript out of range - Array empty

    RESIZE! Brilliant. I wish I worked with vba more to remember everything. SO MANY THANKS

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] Sheets Array - Subscript Out Of Range
    By goss in forum Excel General
    Replies: 2
    Last Post: 11-29-2012, 12:00 PM
  2. [SOLVED] Subscript out of range on Array
    By ZiadzExcel in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 09-26-2012, 11:35 AM
  3. Subscript out of range error while populating array from range.
    By Aussiexile in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 11-04-2010, 02:22 AM
  4. 1D Array Problem (Subscript Out Of Range)
    By John in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 06-30-2006, 02:10 PM
  5. Subscript out of range - multi array
    By Buffyslay in forum Excel General
    Replies: 6
    Last Post: 02-15-2006, 10:15 AM

Tags for this Thread

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