+ Reply to Thread
Results 1 to 6 of 6

Subscript out of range

  1. #1
    Forum Contributor
    Join Date
    02-18-2013
    Location
    canada
    MS-Off Ver
    Excel 2003
    Posts
    112

    Subscript out of range

    Hi. I am getting error "Subscript out of range" on below simple code. Can anybody explain why. Thank you very much.

    Please Login or Register  to view this content.

  2. #2
    Forum Expert mikerickson's Avatar
    Join Date
    03-30-2007
    Location
    Davis CA
    MS-Off Ver
    Excel 2011
    Posts
    6,229

    Re: Subscript out of range

    My guess would be that book1.xls is misspelt. Perhaps it's .xlsm.
    _
    ...How to Cross-post politely...
    ..Wrap code by selecting the code and clicking the # or read this. Thank you.

  3. #3
    Valued Forum Contributor
    Join Date
    06-29-2014
    Location
    Australia
    MS-Off Ver
    MSO 365
    Posts
    1,098

    Re: Subscript out of range

    Hello Itselflearn,

    That particular error usually means that the code can't find the destination book or sheet.

    If you are trying to paste into another work book, make sure that it is open.

    If you are trying to paste into the same work book, check that all spelling is correct (book1 or Book1?) including cases and punctuation. Also check that the file extension is the correct type (xls or xlsx etc.)

    Cheerio,
    vcoolio.

  4. #4
    Forum Contributor
    Join Date
    02-18-2013
    Location
    canada
    MS-Off Ver
    Excel 2003
    Posts
    112

    Re: Subscript out of range

    mikerickson and vcoolio - thank you so much for your help. you are right. the file names has chganged to book1.xlsm. it is now working. thank you.

  5. #5
    Forum Expert mikerickson's Avatar
    Join Date
    03-30-2007
    Location
    Davis CA
    MS-Off Ver
    Excel 2011
    Posts
    6,229

    Re: Subscript out of range

    You're welcome.

    By the way, the argument of Workbooks is case insensitive.

    Please Login or Register  to view this content.

  6. #6
    Valued Forum Contributor
    Join Date
    06-29-2014
    Location
    Australia
    MS-Off Ver
    MSO 365
    Posts
    1,098

    Re: Subscript out of range

    Hello Itselflearn,

    You're welcome. Glad we could help.

    Cheerio,
    vcoolio.

+ 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. Replies: 1
    Last Post: 06-15-2015, 01:56 AM
  2. [SOLVED] Subscript out of range
    By jshaw82 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-28-2015, 06:44 PM
  3. Subscript Out of Range
    By blyzzard in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 12-06-2013, 05:25 PM
  4. [SOLVED] Subscript out of Range...
    By dlsmith36 in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 07-01-2013, 03:30 PM
  5. subscript out of range
    By josros60 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 01-17-2013, 06:33 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