+ Reply to Thread
Results 1 to 4 of 4

Run time error 9 Subscript out of range

  1. #1
    Forum Contributor
    Join Date
    01-05-2011
    Location
    India
    MS-Off Ver
    Excel 2013
    Posts
    243

    Run time error 9 Subscript out of range

    Hi

    One the attached excel macro I am receiving run time error 9 subscript out of range. I am also attaching the text file that requires to execute the macro.

    Please help to solve the debug.

    Regards,
    Vijay
    Attached Files Attached Files

  2. #2
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: Run time error 9 Subscript out of range

    The array result has a first lower bound of 1 not 0.

    When you get the error here, j is 0.
    Please Login or Register  to view this content.
    If posting code please use code tags, see here.

  3. #3
    Forum Contributor
    Join Date
    01-05-2011
    Location
    India
    MS-Off Ver
    Excel 2013
    Posts
    243

    Re: Run time error 9 Subscript out of range

    I am getting error for the below line

    result(j, n + 5) = Trim(objmatches(0).submatches(n))

  4. #4
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: Run time error 9 Subscript out of range

    That's probably because j is 0.

    You'll get that error with any similar code whenever j is 0.

+ 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