Results 1 to 8 of 8

Help with error run-time error '9" (subscript out of Range)

Threaded View

  1. #1
    Forum Contributor
    Join Date
    01-31-2011
    Location
    Canada
    MS-Off Ver
    Excel 2010
    Posts
    191

    Help with error run-time error '9" (subscript out of Range)

    Hello All,

    this is in regards to my previous post

    https://www.excelforum.com/excel-gen...heet-name.html
    Im using the code below but when Im Adding, Deleting rows it keep showing me the error.


    Private Sub Worksheet_Change(ByVal Target As Range)
    
    If Intersect(Target, Range("$B:$C")) Is Nothing Then Exit Sub
    
    Dim Lot1() As String
    Dim Lot2() As String
    
    
    Lot1 = Split(Cells(Target.Row, "B"), " ")
    Lot2 = Split(Cells(Target.Row, "C"), " ")
    Sheets(1).Name = Lot1(UBound(Lot1)) & " vs " & Lot2(UBound(Lot2))
    
    End Sub
    Please help me to remove the popping up error.
    Attached is the file that Im using.


    Thank you
    Attached Files Attached Files
    Last edited by thong127; 05-02-2018 at 01:40 PM. Reason: Upload the sample file

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. VBA Error - Run Time Error 9 - Subscript out if range
    By theskyscraper1 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 07-16-2017, 09:07 PM
  2. "Run-time error '9': Subscript out of range" in some computers!
    By m.zaeim in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 06-14-2016, 04:03 PM
  3. "Run-time error '9': Subscript out of range" when referencing between workbooks
    By roberts23 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 08-08-2014, 10:33 AM
  4. [SOLVED] "run time error 9 subscript out of range" Help?
    By AMV in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-24-2014, 04:54 PM
  5. [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
  6. Replies: 1
    Last Post: 12-15-2011, 10:59 AM
  7. Error msgs: "Object varible or with block variable not set"; "subscript out of range"
    By menyanthe in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 10-26-2009, 04:58 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