+ Reply to Thread
Results 1 to 3 of 3

subscript out of range error when slicing array

  1. #1
    Registered User
    Join Date
    06-22-2016
    Location
    Minnesota
    MS-Off Ver
    2013
    Posts
    20

    subscript out of range error when slicing array

    As stated on other posts, I'm a rookie and am now trying to learn how to slice arrays using the method shown here: https://usefulgyaan.wordpress.com/20...lication-index.

    However, when using the test code shown below, I get a "subscript out of range" message for the MsgBox command. Can anyone tell my why arrtemp(1) will not return a value? I want to be able to slice off the columns of the arrtest array into a 1-dimensional array so that I can easily mind the max/min value of the column. TIA.

    Please Login or Register  to view this content.

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

    Re: subscript out of range error when slicing array

    MsgBox (arrtemp(1, 1))

  3. #3
    Registered User
    Join Date
    06-22-2016
    Location
    Minnesota
    MS-Off Ver
    2013
    Posts
    20

    Re: subscript out of range error when slicing array

    Yes, I figured that out shortly after posting but have been having problems getting back onto the site to remove my question. I don't know if I have slow internet or what, but it crashed and stalled several times before it finally worked just now. I didn't realize that the Index function would return a 2D array when only slicing off 1 "column". Thanks and sorry for the dumb question.

+ 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] Subscript error from Selecting array of sheets
    By coreytroy in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 12-10-2012, 03:13 AM
  2. [SOLVED] Select Sheets based on variable array -ERROR 9 Subscript out of range
    By airmiles in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 09-19-2012, 07:28 PM
  3. Defining Array - Runtime error 9, Subscript out of range error
    By MaartenW in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 02-03-2012, 07:32 AM
  4. Array slicing optimisation
    By Kyle123 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 02-01-2012, 10:43 AM
  5. redim array error....subscript out of range
    By welchs101 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 11-07-2011, 11:07 AM
  6. 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
  7. dynamic array redim preserve: run-time error 9, Subscript out of range.
    By Broesel in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 07-20-2009, 08:39 AM
  8. [SOLVED] Subscript out range error when redimensioning dynamic array
    By Crazy Cat in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 01-12-2006, 02:30 AM

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