+ Reply to Thread
Results 1 to 6 of 6

Subscript out of Range error

  1. #1
    Registered User
    Join Date
    07-21-2014
    Location
    malaysia
    MS-Off Ver
    2013
    Posts
    30

    Subscript out of Range error

    Any expert here know about this error?? my excel vba code can be run n work but sometime will gv me "Subscript out of Range error" error....any1 knoe y will cause this happend?? sometimes for some excel WB sheet can be run......for some WB it gv me this error.....strange....= =''

  2. #2
    Forum Expert
    Join Date
    12-10-2006
    Location
    Sydney
    MS-Off Ver
    Office 365
    Posts
    3,527

    Re: Subscript out of Range error

    Hi there,

    That error is usually a result of a tab being referred to that doesn't exist in the workbook.

    For example, this line of code will produce that error if there's no Sheet5 in the active workbook:

    Please Login or Register  to view this content.
    HTH

    Robert
    Last edited by Trebor76; 08-05-2014 at 10:27 PM.
    ____________________________________________
    Please ensure you mark your thread as Solved once it is. Click here to see how
    If this post helps, please don't forget to say thanks by clicking the star icon in the bottom left-hand corner of my post

  3. #3
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2406 Win 11 Home 64 Bit
    Posts
    23,983

    Re: Subscript out of Range error

    Suggest you upload a copy of your workbook along with your VBA code. I also suggest you not use Texting language in your posts as it may be confusing to many users and is not an appropriate means of communication in forums.
    Alan עַם יִשְׂרָאֵל חַי


    Change an Ugly Report with Power Query
    Database Normalization
    Complete Guide to Power Query
    Man's Mind Stretched to New Dimensions Never Returns to Its Original Form

  4. #4
    Forum Expert
    Join Date
    11-24-2013
    Location
    Paris, France
    MS-Off Ver
    Excel 2003 / 2010
    Posts
    9,831

    Re: Subscript out of Range error


    Not strange, just a bad code …

  5. #5
    Registered User
    Join Date
    07-21-2014
    Location
    malaysia
    MS-Off Ver
    2013
    Posts
    30

    Re: Subscript out of Range error

    Quote Originally Posted by Trebor76 View Post
    Hi there,

    That error is usually a result of a tab being referred to that doesn't exist in the workbook.

    For example, this line of code will produce that error if there's no Sheet5 in the active workbook:

    Please Login or Register  to view this content.
    HTH

    Robert
    ya u r correct...and i solve it already....thk a lot for reply~~thank~~

  6. #6
    Forum Expert
    Join Date
    12-10-2006
    Location
    Sydney
    MS-Off Ver
    Office 365
    Posts
    3,527

    Re: Subscript out of Range error

    You're welcome

+ 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] Run-time error '9': subscript out of range - error occurs on multiple computers except one
    By BrettE in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 02-06-2014, 11:19 PM
  2. Runtime Error - Subscript out of Range / Object Error
    By JHRice in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 05-04-2012, 05:14 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. Runtime Error - Subscript out of range despite On Error statement
    By DoctorG in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 07-28-2006, 11:05 AM
  5. [SOLVED] Type Mismatch error & subscript out of range error
    By Jeff Wright in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 05-14-2005, 03:06 PM

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