+ Reply to Thread
Results 1 to 7 of 7

subscript is out of range

  1. #1
    Registered User
    Join Date
    10-21-2019
    Location
    Baku, Azerbaijan
    MS-Off Ver
    2018
    Posts
    9

    subscript is out of range

    The code below pastes clipboard and then stretches the pasted formula. But occasionally I get subscript is out of range error. Why is that?

    I use this code for sheet called TOC


    HTML Code: 

  2. #2
    Forum Expert rorya's Avatar
    Join Date
    08-13-2008
    Location
    East Sussex, UK
    MS-Off Ver
    365 Ent Monthly Channel / Insiders Beta
    Posts
    8,918

    Re: subscript is out of range

    The only reason I could see for that would be if the active workbook at the time doesn't have a TOC worksheet.
    Rory

  3. #3
    Registered User
    Join Date
    10-21-2019
    Location
    Baku, Azerbaijan
    MS-Off Ver
    2018
    Posts
    9

    Re: subscript is out of range

    In all workbooks that I have there is a TOC. I usually copy the clipboard from excel workbook that does not have a TOC sheet. I think, excel confuses workbooks??

    The workflow for me is to open two workbooks at the same time and copy from one which does not contain TOC and drop to another one which contains TOC sheet

  4. #4
    Forum Expert rorya's Avatar
    Join Date
    08-13-2008
    Location
    East Sussex, UK
    MS-Off Ver
    365 Ent Monthly Channel / Insiders Beta
    Posts
    8,918

    Re: subscript is out of range

    Quote Originally Posted by ulvrah View Post
    In all workbooks that I have there is a TOC. I usually copy the clipboard from excel workbook that does not have a TOC sheet.
    Slight contradiction there. I stand by my original suggestion as I can't see anything else that would cause that error - unless it's actually being caused by other code.

  5. #5
    Registered User
    Join Date
    10-21-2019
    Location
    Baku, Azerbaijan
    MS-Off Ver
    2018
    Posts
    9

    Re: subscript is out of range

    Appreciate your opinion on this. I have one more code which is as follows:

    HTML Code: 

  6. #6
    Forum Expert rorya's Avatar
    Join Date
    08-13-2008
    Location
    East Sussex, UK
    MS-Off Ver
    365 Ent Monthly Channel / Insiders Beta
    Posts
    8,918

    Re: subscript is out of range

    If that's being used in a cell formula, it would not cause that error.

  7. #7
    Registered User
    Join Date
    10-21-2019
    Location
    Baku, Azerbaijan
    MS-Off Ver
    2018
    Posts
    9

    Re: subscript is out of range

    Strangely enough when I copy clipboard and click on TOC worksheet and then play the macros from Alt + F11 it works. But not otherwise

+ 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] Subscript Out of Range
    By Jefffey in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 08-01-2017, 02:31 PM
  2. Why is subscript out of range?
    By falcony03 in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 07-18-2016, 03:57 AM
  3. Replies: 1
    Last Post: 06-15-2015, 01:56 AM
  4. [SOLVED] Getting Subscript Out of Range
    By bbmak in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-26-2014, 08:08 PM
  5. Excel 2007 : Subscript out of range
    By ususgoreng in forum Excel General
    Replies: 3
    Last Post: 05-26-2011, 06:30 PM
  6. Subscript out of range error while populating array from range.
    By Aussiexile in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 11-04-2010, 02:22 AM
  7. Subscript out of range error when trying to select a range
    By welchs101 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 04-01-2010, 07:57 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