+ Reply to Thread
Results 1 to 3 of 3

Subscript out of Range error on recorded macro

  1. #1
    Registered User
    Join Date
    06-04-2018
    Location
    Los Angeles
    MS-Off Ver
    Office365
    Posts
    2

    Subscript out of Range error on recorded macro

    I believe the code is looking for specific workbooks and/or sheets and I need this macro to run ambiguously. I get a 'Subscript out of Range' (error 9).

    Also, I am sure the code is extremely messy and would also seek direction on how best to clean it all up. The code at the top was entered by me after I recorded the macro in hopes of correcting the issue, which did not resolve it. I am new to VBA so I would appreciate direction on how best to clean it all up.

    Any guidance would be greatly appreciated.

    I have attached the code in question.
    Attached Files Attached Files

  2. #2
    Forum Expert gmr4evr1's Avatar
    Join Date
    11-24-2014
    Location
    Texas
    MS-Off Ver
    Office 2010 and 2007
    Posts
    3,448

    Re: Subscript out of Range error on recorded macro

    Benatfox,
    Hi, welcome to the forum. Could you attach a sample workbook with you code and the all the sheets you are using within the workbook? It may be difficult for us to get the same error you are getting without it.
    1N73LL1G3NC3 15 7H3 4B1L17Y 70 4D4P7 70 CH4NG3 - 573PH3N H4WK1NG
    You don't have to add Rep if I have helped you out (but it would be nice), but please mark the thread as SOLVED if your issue is resolved.

    Tom

  3. #3
    Registered User
    Join Date
    06-04-2018
    Location
    Los Angeles
    MS-Off Ver
    Office365
    Posts
    2

    Re: Subscript out of Range error on recorded macro

    Hi gmr4evr1,

    Thank you for the reply! I have attached the entire work book as requested, which also contains the module in question.

    I wrote this using the macro recorder and tried to clean it up a bit, but I'm sure it's still a mess.

    Basically, I need to run the macro, which will create three additional tabs - all with the same data, just viewed differently. Right now I am getting a subscript out of range error and my assumption is that it's because the macro is referring to specific workbook or worksheets.

    Thank you in advance for your help!
    Ben
    Attached Files Attached Files

+ 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. Any guess on why this macro is causing a subscript out of range error?
    By 80Wil in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 04-21-2017, 07:07 PM
  2. [SOLVED] Correcting Macro Run-Time error '9' - Subscript out of range
    By Cdub529 in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 08-19-2016, 04:14 PM
  3. Macro to Add/Delete Sheet - Subscript Out of Range Error
    By gophins in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 03-26-2015, 10:28 AM
  4. Macro - Run Time Error 9 (Subscript out of range)
    By Joshdm0716 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-26-2014, 07:50 AM
  5. Subscript Out of Range (Error) when running a macro
    By trevor2524 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 12-11-2013, 04:38 PM
  6. [SOLVED] Macro - Subscript out of range error
    By hariprasadcp in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 01-24-2013, 08:15 AM
  7. [SOLVED] fix a macro that gets a run-time error '9' subscript out of range
    By kellys in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 03-09-2006, 03:55 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