+ Reply to Thread
Results 1 to 4 of 4

debugging error "cannot jump to 'sheets' because it is hidden" help please!!

  1. #1
    Registered User
    Join Date
    11-21-2017
    Location
    Naples, Florida
    MS-Off Ver
    MS Office 2013
    Posts
    4

    Unhappy debugging error "cannot jump to 'sheets' because it is hidden" help please!!

    Hello all,
    I am new to VBA and entirely self taught via my own research and youtube. I am attempting to sort the data on a sheet ascending by their value and I keep getting this error "cannot jump to 'sheets' because it is hidden". I don't understand enough to know what to change. The following code is where the error pops up.

    Please Login or Register  to view this content.
    I have the exact code pertaining to "Dyn_Sort_Last" for sorting info by last name on another sheet that works just fine. Not sure where I am going wrong, any help would be greatly appreciated.

    this is my first post... hope I followed all of the rules.

  2. #2
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: debugging error "cannot jump to 'sheets' because it is hidden" help please!!

    Hi and welcome to the forum.

    When creating VBA code you should avoid instructions like .Activate & .Select. These are rarely necessary. You can generally work with objects / ranges etc by addressing them directly with your code. The macro recorder is great for learning and capturing the basic instructions but it will almost always need editing to tidy it up and for the removal of stuff that isn't necessary.

    Remove the

    Formula: copy to clipboard
    Please Login or Register  to view this content.


    line since if the Performance sheet is hidden then obviously you can't physically see it and hence select it. If you want to unhide the sheet then use

    Please Login or Register  to view this content.
    And here's another tip. Avoid using sheet tab names in VBA code. Users can too easily change them and if they're hard coded a macro will fail. Always use the Sheet VB Codename - that's the first item shown for each sheet in the Project Explorer list of sheets. i.e assuming the Perfomance sheet is Sheet1 use

    Please Login or Register  to view this content.
    Richard Buttrey

    RIP - d. 06/10/2022

    If any of the responses have helped then please consider rating them by clicking the small star icon below the post.

  3. #3
    Forum Expert
    Join Date
    04-01-2013
    Location
    East Auckland
    MS-Off Ver
    Excel 365
    Posts
    1,343

    Re: debugging error "cannot jump to 'sheets' because it is hidden" help please!!

    Just in case Richards post doesn't solve your issue -

    This part of the code works OK for me. (other than that you seem to refer to a named range you are selecting then you sort by a specific set range B5:AI20, maybe those are supposed to refer to the same thing?)

    Do you have a form or something with some sort of object called "sheets" on it?
    Last edited by scottiex; 11-21-2017 at 04:02 PM.
    If you want something done right... find a forum and ask an online expert.

    Time flies like an arrow. Fruit flies like a banana.

  4. #4
    Registered User
    Join Date
    11-21-2017
    Location
    Naples, Florida
    MS-Off Ver
    MS Office 2013
    Posts
    4

    Re: debugging error "cannot jump to 'sheets' because it is hidden" help please!!

    Thank you for the quick response. Your suggestion worked perfectly. Now I am on to the rest of the document, its great to know that this forum is available. Thanks again!

+ 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] Debugging in Visual Basic | Compile Error: "Else without If"
    By awenk in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 04-13-2015, 06:35 PM
  2. [SOLVED] Exclude Hidden Sheets/"Home" Sheet when creating hyperlinks
    By Kenny Blackwell in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 03-30-2015, 12:36 PM
  3. Debugging Program Error: "Sub or Function Not defined"
    By crisshinn in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 03-14-2011, 11:34 AM
  4. Runtime Error Does Not Occur during "Step Into" Debugging
    By TwoyTaylor in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 06-04-2009, 09:18 AM
  5. Excel 2003 "Compile error in hidden module: ThisWorkbook"
    By JeffBrown in forum Excel General
    Replies: 1
    Last Post: 11-05-2007, 04:02 PM
  6. [SOLVED] "With Sheets" Issue - macro on one sheet to affect hidden rows on other sheets
    By Punsterr in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 02-21-2006, 12:10 AM
  7. Replies: 4
    Last Post: 01-21-2005, 08:06 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