+ Reply to Thread
Results 1 to 8 of 8

Run time error 9 - subscript out of range

  1. #1
    Registered User
    Join Date
    06-26-2014
    Location
    Christchurch, New Zealand
    MS-Off Ver
    2010
    Posts
    43

    Run time error 9 - subscript out of range

    Hi

    I have a piece of code that's worked for a long time but has decided to stop recently.

    Does anyone know what may be causing this?

    Please Login or Register  to view this content.
    Thanks
    Jo

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

    Re: Run time error 9 - subscript out of range

    Hi Jo2710,

    That error message is usually the result of the code not finding the exact sheet name it's been told to find. So at a guess I'd say there's no tab called "QuoteTracker" (note there's no space as in the current workbook) in the workbook the code is trying to paste into.

    HTH

    Robert
    ____________________________________________
    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
    Registered User
    Join Date
    06-26-2014
    Location
    Christchurch, New Zealand
    MS-Off Ver
    2010
    Posts
    43

    Re: Run time error 9 - subscript out of range

    Hi Robert

    Thanks for your quick response. The sheets are both definitely there and I've tried with the naming convention Sheet1 also but still no luck. It's making me pull my hair out!!

    Thanks
    Jo

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

    Re: Run time error 9 - subscript out of range

    Not sure as it works for me

    Post the code you're using to both define and set your two workbook variables.

  5. #5
    Registered User
    Join Date
    06-26-2014
    Location
    Christchurch, New Zealand
    MS-Off Ver
    2010
    Posts
    43

    Re: Run time error 9 - subscript out of range

    This is the whole piece of code:

    Please Login or Register  to view this content.

  6. #6
    Registered User
    Join Date
    06-26-2014
    Location
    Christchurch, New Zealand
    MS-Off Ver
    2010
    Posts
    43

    Re: Run time error 9 - subscript out of range

    I figured it out, I feel stupid now! Some had renamed the sheet and corrected it but put a space after so I hadn't picked it up!

    Thanks so much for your time

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

    Re: Run time error 9 - subscript out of range

    OK - no problem. I'll post this anyway as you might find it useful as it will work as long as "Quote" is part of the sheet name:

    Please Login or Register  to view this content.
    Regards,

    Robert

  8. #8
    Forum Guru bakerman2's Avatar
    Join Date
    10-03-2012
    Location
    Antwerp, Belgium
    MS-Off Ver
    MO Prof Plus 2016
    Posts
    6,907

    Re: Run time error 9 - subscript out of range

    And to avoid the repetition of sheetnames.
    Please Login or Register  to view this content.
    Last edited by bakerman2; 06-13-2016 at 11:32 PM.
    Avoid using Select, Selection and Activate in your code. Use With ... End With instead.
    You can show your appreciation for those that have helped you by clicking the * at the bottom left of any of their posts.

+ 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
    By exec_gerbil in forum Excel Programming / VBA / Macros
    Replies: 14
    Last Post: 02-22-2024, 12:40 AM
  2. [SOLVED] Subscript Out of Range Run Time Error 9: Please Help
    By Pauly723 in forum Excel Programming / VBA / Macros
    Replies: 16
    Last Post: 12-23-2014, 06:30 PM
  3. 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
  4. [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
  5. Run-time error 9 subscript out of range
    By thebigman in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 04-01-2010, 05:00 PM
  6. Run-time Error '9': Subscript out of range
    By tryaz in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 11-23-2009, 02:13 PM
  7. Run time error 9 : Subscript out of range
    By JAtz_DA_WAY in forum Excel General
    Replies: 6
    Last Post: 08-29-2005, 03:26 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