+ Reply to Thread
Results 1 to 11 of 11

Subscript is out of range Error - can't find solution

  1. #1
    Forum Contributor
    Join Date
    09-10-2008
    Location
    Phoenix, AZ
    MS-Off Ver
    Office 365
    Posts
    985

    Subscript is out of range Error - can't find solution

    Hello Everyone,

    Unable to find a solution for the "subscript is out of range error I am getting.

    Please Login or Register  to view this content.
    Does anyone have an Answer for this?

    John
    Last edited by JJFletcher; 04-16-2016 at 12:17 PM.

  2. #2
    Forum Expert
    Join Date
    10-09-2014
    Location
    Newcastle, England
    MS-Off Ver
    2003 & 2013
    Posts
    1,986

    Re: Subscript is out of range Error - can't find solution

    Do both of those workbooks and their associated "Goals" sheets definitely exist?
    If someone has helped you then please add to their Reputation

  3. #3
    Forum Expert BadlySpelledBuoy's Avatar
    Join Date
    06-14-2013
    Location
    East Sussex, UK
    MS-Off Ver
    365
    Posts
    7,468

    Re: Subscript is out of range Error - can't find solution

    Are the file names and extensions definitely entered correctly?

    BSB

  4. #4
    Forum Contributor
    Join Date
    09-10-2008
    Location
    Phoenix, AZ
    MS-Off Ver
    Office 365
    Posts
    985

    Re: Subscript is out of range Error - can't find solution

    Hi Folks

    Thanks for the speedy reply... To answer both of your questions - both workbooks and sheets (Goals) do exist and spelled correctly

    John

  5. #5
    Forum Expert BadlySpelledBuoy's Avatar
    Join Date
    06-14-2013
    Location
    East Sussex, UK
    MS-Off Ver
    365
    Posts
    7,468

    Re: Subscript is out of range Error - can't find solution

    I have just created two workbooks with the same names as your script suggests and named a sheet in each to "Goals".
    Ran the code and it worked fine, unless:

    A) The workbook it's pasting into was closed
    B) The sheet name is incorrect, i.e. "Goals " with a trailing space

    Could either of those be the issue?

    BSB

  6. #6
    Forum Contributor
    Join Date
    09-10-2008
    Location
    Phoenix, AZ
    MS-Off Ver
    Office 365
    Posts
    985

    Re: Subscript is out of range Error - can't find solution

    This test was run from the office... I do not received the error here at the house... Identical files and Sheet Names - one question I cannot answer is were both files open at the office during the error - I thought they were both open... I may be incorrect...

    Question... I am using Excel 2016 and the Office has 2010 - is it possible that this could be the reason?

    Folks... sorry for asking questions without being more prepared.... Consider this issue closed - I will comeback later in the week with an update

    John
    Last edited by JJFletcher; 04-16-2016 at 12:09 PM.

  7. #7
    Forum Expert BadlySpelledBuoy's Avatar
    Join Date
    06-14-2013
    Location
    East Sussex, UK
    MS-Off Ver
    365
    Posts
    7,468

    Re: Subscript is out of range Error - can't find solution

    'm on Excel 2010 here and it worked fine so I wouldn't have thought it was a compatibility issue. Especially not with such simple code as pasting from one file into another.

    I would suspect the target file not being open is the culprit here. Try it on your machine with the target workbook closed and see what happens. It will error out because the code above doesn't specify a file path. But I suspect this is a much cut down version of the code.

    BSB

  8. #8
    Forum Contributor
    Join Date
    09-10-2008
    Location
    Phoenix, AZ
    MS-Off Ver
    Office 365
    Posts
    985

    Re: Subscript is out of range Error - can't find solution

    BSB,

    I did the test and I get the error when the 2016April5Goals.xlsm is closed...

    You pose an interesting question for me...If the Workbooks are both on the users desktop is it then required to identify a specific file path? I thought not???

    John
    Last edited by JJFletcher; 04-16-2016 at 12:14 PM. Reason: spelling

  9. #9
    Forum Expert BadlySpelledBuoy's Avatar
    Join Date
    06-14-2013
    Location
    East Sussex, UK
    MS-Off Ver
    365
    Posts
    7,468

    Re: Subscript is out of range Error - can't find solution

    You wouldn't have to specify a path if both workbooks were open at the time of manipulation.

    BSB

  10. #10
    Forum Contributor
    Join Date
    09-10-2008
    Location
    Phoenix, AZ
    MS-Off Ver
    Office 365
    Posts
    985

    Re: Subscript is out of range Error - can't find solution

    BSB,

    Excellent... I will come back next week and update... Thanks for your time

    John

  11. #11
    Forum Expert BadlySpelledBuoy's Avatar
    Join Date
    06-14-2013
    Location
    East Sussex, UK
    MS-Off Ver
    365
    Posts
    7,468

    Re: Subscript is out of range Error - can't find solution

    I'm 99.9% sure the target workbook is closed and that's why the code is throwing its toys out of the pram.

    Happy to help. Let us know how you get on next week.

    BSB

+ 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 - 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
  2. [SOLVED] Find expression causing "Subscript out of range" error
    By aseret in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 07-08-2013, 12:05 AM
  3. Error "Subscript out of range", cant seem to find where code is wrong
    By KeithMale in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 06-14-2013, 07:07 PM
  4. Runtime Error - Subscript out of Range / Object Error
    By JHRice in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 05-04-2012, 05:14 PM
  5. 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
  6. 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
  7. 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