+ Reply to Thread
Results 1 to 7 of 7

Macro for hiding sheets

  1. #1
    Registered User
    Join Date
    10-22-2013
    Location
    Iowa
    MS-Off Ver
    Excel 2010
    Posts
    36

    Macro for hiding sheets

    I have been working on a macro to close a number of sheets, the file contains over 100 sheets lol (maybe part of the problem). But when running the macro I run across an error [Run-time error '9': Subscript out of range]. I am far from an expert in excel and am mostly self taught, I copied and pasted most of the macro and I will paste the full macro below in green: Error message and line will be highlighted in red. Remember, I'm not an expert, so if someone could point me in the right direction that would be fantastic.
    Please Login or Register  to view this content.
    Last edited by Fotis1991; 10-22-2013 at 11:14 AM. Reason: pls use code tags around your codes.

  2. #2
    Registered User
    Join Date
    06-04-2013
    Location
    Toronto
    MS-Off Ver
    Excel 2003
    Posts
    36

    Re: Macro for hiding sheets

    I would make sure "StoneAgeWeapons" exists and that it is spelled correctly no space on the end. For reference, Run-time error 9: Subscript out of range means you are referencing a non-existent array element.

  3. #3
    Registered User
    Join Date
    10-22-2013
    Location
    Iowa
    MS-Off Ver
    Excel 2010
    Posts
    36

    Re: Macro for hiding sheets

    Alright thanks, I was checking the name to make sure it was right, but I never checked for spaces at the end of the sheet name, will check right now, plus it's nice to know exactley what that means

  4. #4
    Forum Expert
    Join Date
    06-12-2012
    Location
    Ridgefield Park, New Jersey
    MS-Off Ver
    Excel 2003,2007,2010
    Posts
    10,241

    Re: Macro for hiding sheets

    Are you intentionally using that light green color to make your code harder to read and understand?

  5. #5
    Registered User
    Join Date
    10-22-2013
    Location
    Iowa
    MS-Off Ver
    Excel 2010
    Posts
    36

    Re: Macro for hiding sheets

    LOL you were completely right, there was a space at the end, I can't believe it never thought of looking at that, thank you very much am_hawk

  6. #6
    Registered User
    Join Date
    10-22-2013
    Location
    Iowa
    MS-Off Ver
    Excel 2010
    Posts
    36

    Re: Macro for hiding sheets

    Sorry John, I'll make sure to use more friendly colors next time, i see if there is standards for the forum listed

  7. #7
    Forum Expert
    Join Date
    06-12-2012
    Location
    Ridgefield Park, New Jersey
    MS-Off Ver
    Excel 2003,2007,2010
    Posts
    10,241

    Re: Macro for hiding sheets

    Quote Originally Posted by mdoverl View Post
    Sorry John, I'll make sure to use more friendly colors next time, i see if there is standards for the forum listed
    Some us guys are old and can hardly see it in black.

+ 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. Re-Naming Sheets per Cell data & Hiding Sheets
    By dej222 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 08-26-2009, 10:20 PM
  2. hiding sheets but still letting macros run when printing hidden sheets
    By stevesunfold in forum Excel Programming / VBA / Macros
    Replies: 24
    Last Post: 11-13-2008, 04:35 AM
  3. Hiding Sheets and Macro Buttons
    By AvalonRaven in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 03-22-2007, 10:27 AM
  4. Locking Sheets / Hiding Sheets
    By Lee Harris in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 11-29-2005, 03:25 AM
  5. [SOLVED] hiding sheets
    By steve in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 11-28-2005, 05: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