+ Reply to Thread
Results 1 to 6 of 6

Solving subscript out of range error 9

  1. #1
    Registered User
    Join Date
    02-14-2020
    Location
    Paris
    MS-Off Ver
    2016 on Mac
    Posts
    81

    Solving subscript out of range error 9

    Hello All,

    I am having a subscript out of range error 9 and I can't solve it.

    the error is at the level of Perfect_Match(i, 1) = Tag(i, 1)

    HTML Code: 

  2. #2
    Forum Guru
    Join Date
    09-10-2017
    Location
    Chippenham, England
    MS-Off Ver
    365
    Posts
    12,365

    Re: Solving subscript out of range error 9

    Try
    Please Login or Register  to view this content.

  3. #3
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,613

    Re: Solving subscript out of range error 9

    Please Login or Register  to view this content.
    If Range("tag") has any blank cells, dim_tag will be smaller than Range("tag") and so will the Perfect_Match array.

    While i <= UBound(Tag) will go beyond the bounds of Perfect_Match. Does that help?

    Perhaps you want...
    Please Login or Register  to view this content.
    Last edited by AlphaFrog; 04-15-2020 at 08:53 AM.
    Surround your VBA code with CODE tags e.g.;
    [CODE]your VBA code here[/CODE]
    The # button in the forum editor will apply CODE tags around your selected text.

  4. #4
    Registered User
    Join Date
    02-14-2020
    Location
    Paris
    MS-Off Ver
    2016 on Mac
    Posts
    81

    Re: Solving subscript out of range error 9

    I did . It works great thx.

  5. #5
    Registered User
    Join Date
    02-14-2020
    Location
    Paris
    MS-Off Ver
    2016 on Mac
    Posts
    81

    Re: Solving subscript out of range error 9

    Thx AlphaFrog

  6. #6
    Forum Guru
    Join Date
    09-10-2017
    Location
    Chippenham, England
    MS-Off Ver
    365
    Posts
    12,365

    Re: Solving subscript out of range error 9

    Glad to help & thanks for the feedback

+ 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. VBA script error help: Run-time error'9': Subscript out of range.
    By TrinhNgocAnh in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 10-20-2018, 05:34 AM
  2. [SOLVED] Help with error run-time error '9" (subscript out of Range)
    By thong127 in forum Excel General
    Replies: 7
    Last Post: 05-02-2018, 02:17 PM
  3. [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
  4. 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
  5. 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
  6. Subscript out of range error - save copy error
    By bg18461 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-13-2006, 11:53 AM
  7. [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