+ Reply to Thread
Results 1 to 10 of 10

Runtime error 9 Script out of range

  1. #1
    Forum Contributor
    Join Date
    02-16-2011
    Location
    Maharashtra, Thane
    MS-Off Ver
    Excel 2021
    Posts
    140

    Runtime error 9 Script out of range

    Dear Mr. Mumps,
    I have created a thread for stock updatation and mentioned the below link of it.
    https://www.excelforum.com/excel-pro...le-sheets.html
    But when i am using this code to a new workbook it will not showing error message i.e. Subscript out of Range.
    Kindly help. Beloe mentioned the code details.
    Please Login or Register  to view this content.
    Have put the code tag as advised. Thanks.
    Last edited by shyampanda; 09-27-2020 at 07:01 AM.

  2. #2
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,830

    Re: Runtime error 9 Script out of range

    Administrative Note:

    We would very much like to help you with your query, however you need to include code tags around your code.

    Please take a moment to add the tags. Posting code between tags makes your code much easier to read and copy for testing, and it also maintains VBA formatting.

    Please see Forum Rule #2 about code tags and adjust accordingly. Click on Edit to open your post, then highlight your code and click the # icon at the top of your post window. More information about these and other tags can be found here

    (Note: this change is not optional. No help to be offered until this moderation request has been fulfilled.)
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

  3. #3
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Regina
    MS-Off Ver
    MS 365
    Posts
    13,481

    Re: Runtime error 9 Script out of range

    What line errors?

  4. #4
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,440

    Re: Runtime error 9 Script out of range

    It looks as though the sheet(s) defined in column 1 do not exist.

    Please Login or Register  to view this content.
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  5. #5
    Forum Contributor
    Join Date
    02-16-2011
    Location
    Maharashtra, Thane
    MS-Off Ver
    Excel 2021
    Posts
    140

    Re: Runtime error 9 Script out of range

    Dear Sir,
    Getting error for this line
    Please Login or Register  to view this content.
    When i am clicking the Stock sheet button "Update Stock" it will show the error. Please provide a solution whereever the stock sheet will be available the code should run. It might be in sheet 1 or some other sheets. attached file for your reference.
    Attached Files Attached Files

  6. #6
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Regina
    MS-Off Ver
    MS 365
    Posts
    13,481

    Re: Runtime error 9 Script out of range

    I don't get an error.

  7. #7
    Forum Expert
    Join Date
    10-06-2017
    Location
    drevni ruchadlo
    MS-Off Ver
    old
    Posts
    2,151

    Re: Runtime error 9 Script out of range

    When 'LastRow' = 1 then 'LastRow - 1' = 0 ==> There is no row '0' in excel worksheets.

  8. #8
    Forum Contributor
    Join Date
    02-16-2011
    Location
    Maharashtra, Thane
    MS-Off Ver
    Excel 2021
    Posts
    140

    Re: Runtime error 9 Script out of range

    Dear Mr. Dave & Porucha,
    Thanks for your response. But i have received the error message and attached herewith the screen shots. Kindly help how to avoid it.
    Attached Images Attached Images

  9. #9
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Regina
    MS-Off Ver
    MS 365
    Posts
    13,481

    Re: Runtime error 9 Script out of range

    I must have been opening a previous version, I get an error now.

    The code requires sheet names to be in column A

    See post #7 explanation
    Last edited by davesexcel; 09-27-2020 at 11:04 AM.

  10. #10
    Forum Contributor
    Join Date
    02-16-2011
    Location
    Maharashtra, Thane
    MS-Off Ver
    Excel 2021
    Posts
    140

    Re: Runtime error 9 Script out of range

    Thanks Mr. Dave.
    I have mentioned sheet names and is working fine. Thanks to update the error.

+ 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. Runtime Error 53 Running Shell Script Mac
    By excelVBA_neophyte in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 07-16-2019, 02:52 PM
  2. VBA error: runtime error 1004 : Method range of object - 'Global' failed.
    By Afjio12 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-28-2019, 04:37 AM
  3. Runtime error '1004': Paste special method of range class error.
    By Daryl Zer0 in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 11-05-2014, 01:44 AM
  4. [SOLVED] VBA Error: Runtime Error 1004: AutoFilter method of Range class failed
    By jl22stac in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 10-03-2013, 07:27 PM
  5. Runtime error off simple script
    By DadaaP in forum Excel Programming / VBA / Macros
    Replies: 12
    Last Post: 08-06-2013, 10:41 PM
  6. [SOLVED] Range error in code, runs alone but not inside my full program, giving runtime error 1004
    By charizzardd in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 08-23-2012, 03:34 PM
  7. 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

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