+ Reply to Thread
Results 1 to 4 of 4

Run-time error '9': Subscript out of range (when using a Class Module)

  1. #1
    Forum Contributor
    Join Date
    11-10-2009
    Location
    Perth, Australia
    MS-Off Ver
    Excel 2007
    Posts
    549

    Run-time error '9': Subscript out of range (when using a Class Module)

    I'm using a Class Module to run a macro when there is a change, in this instance in Column A.
    I get an error message when I use the "Undo" function, for some reason.
    The error message is: Run-time error '9': Subscript out of range
    The debug points to line: UndoList = Application.CommandBars("Standard").Controls("&Undo").List(1)
    Is there any way to stop this?


    THIS WORKBOOK
    Please Login or Register  to view this content.
    MODULE
    Please Login or Register  to view this content.
    CLASS MODULE
    Please Login or Register  to view this content.
    Attached Files Attached Files

  2. #2
    Forum Expert Bob Phillips's Avatar
    Join Date
    09-03-2005
    Location
    Wessex
    MS-Off Ver
    Office 2003, 2010, 2013, 2016, 365
    Posts
    3,284

    Re: Run-time error '9': Subscript out of range (when using a Class Module)

    Oddly, it seems to work fine for me.

    BTW, you can avoid the looping with your worksheet exists function

    Please Login or Register  to view this content.

  3. #3
    Forum Contributor
    Join Date
    11-10-2009
    Location
    Perth, Australia
    MS-Off Ver
    Excel 2007
    Posts
    549

    Re: Run-time error '9': Subscript out of range (when using a Class Module)

    Have you tried Undo after one (1) operation. The issue is not there if two or more things are done.
    I have Windows 10 and Office 2013.
    Also with the above code, does this relate to the error I'm getting.

  4. #4
    Forum Contributor
    Join Date
    11-10-2009
    Location
    Perth, Australia
    MS-Off Ver
    Excel 2007
    Posts
    549

    Re: Run-time error '9': Subscript out of range (when using a Class Module)

    Bumping up.

+ 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. Run time error '9': Subscript out of Range
    By mklindquist0815 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 09-30-2016, 12:35 PM
  2. Run time error 9 subscript out of range
    By Jagadeesank in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 06-30-2015, 03:12 AM
  3. [SOLVED] Method Range error inside a Class module
    By devpp in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 02-12-2015, 12:32 PM
  4. Run-Time error '9' Subscript out of range
    By wahi00 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-29-2014, 09:56 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. Run time error 9 - subscript out of range
    By lukestkd in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-09-2012, 08:06 PM
  7. Module 1 - Subscript out of range error
    By Craigm in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-28-2005, 12:05 PM

Tags for this Thread

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