+ Reply to Thread
Results 1 to 8 of 8

open/close Hidden Tab

  1. #1
    Registered User
    Join Date
    03-03-2016
    Location
    London, England
    MS-Off Ver
    2010
    Posts
    31

    open/close Hidden Tab

    I am looking to have a front page that links to hidden tabs (~100) which then hide again when returning back to front page.

    I have found the following VBA code online however it give Run Time Error 9 when the hyperlink is more than word (e.g. BestPractice is fine | Best Practice produces error). I have tried _ between the words but that doesn't appear to work either.

    If anyone has a solution or a tweak, their help will be greatly apprecaited.

    Please Login or Register  to view this content.
    Last edited by JamesArmitage; 09-23-2020 at 10:18 AM.

  2. #2
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS365 Family 64-bit
    Posts
    24,721

    Re: open/close Hidden Tab

    If the parent sheet has a space, then the string will look like

    'Best Practice'!

    I might try this

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


    That will remove the quote marks before using it as a sheet name.

    Also, you have undeclared variables, which slows down reading the code and can cause bugs. I strongly recommend to everyone that they declare variables. Doing so prevents a lot of bugs and runtime errors.

  3. #3
    Forum Expert Logit's Avatar
    Join Date
    12-23-2012
    Location
    North Carolina
    MS-Off Ver
    Excel 2019 Professional Plus - 2007 Enterprise
    Posts
    7,014

    Re: open/close Hidden Tab

    .
    Apologies for directly addressing your question.

    If you are interested ... here are several different methods of accomplishing your goal :

    Please Login or Register  to view this content.
    Attached Files Attached Files

  4. #4
    Registered User
    Join Date
    03-03-2016
    Location
    London, England
    MS-Off Ver
    2010
    Posts
    31

    Re: open/close Hidden Tab

    thank you. this works how it brings up an error before opening the sheet 'Reference isn't valid'? Any thoughts or recommendations?

    Please Login or Register  to view this content.

  5. #5
    Forum Expert Logit's Avatar
    Join Date
    12-23-2012
    Location
    North Carolina
    MS-Off Ver
    Excel 2019 Professional Plus - 2007 Enterprise
    Posts
    7,014

    Re: open/close Hidden Tab

    .
    Strange why it is not working for you. I am running Excel 2007 and your macros work as designed without error.

    See attached :
    Attached Files Attached Files

  6. #6
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS365 Family 64-bit
    Posts
    24,721

    Re: open/close Hidden Tab

    Quote Originally Posted by JamesArmitage View Post
    thank you. this works how it brings up an error before opening the sheet 'Reference isn't valid'? Any thoughts or recommendations?
    What is the value of strLinkSheet when this error occurs?

  7. #7
    Registered User
    Join Date
    03-03-2016
    Location
    London, England
    MS-Off Ver
    2010
    Posts
    31

    Re: open/close Hidden Tab

    This is the code as it stands. It still opens the tab but the 'Reference isn't valid' error notification appears. Does this help?

    Please Login or Register  to view this content.

  8. #8
    Forum Expert Logit's Avatar
    Join Date
    12-23-2012
    Location
    North Carolina
    MS-Off Ver
    Excel 2019 Professional Plus - 2007 Enterprise
    Posts
    7,014

    Re: open/close Hidden Tab

    .
    Please Login or Register  to view this content.
    Also NOTE: The link wording MUST be the same as the Sheet Name.
    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. Command Button to open hidden sheet and close when de- selected
    By Chris1976 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-30-2020, 03:34 PM
  2. [SOLVED] Open workbook if not already open then close same file if was not already open
    By abhinavbinkar in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 12-30-2018, 02:50 AM
  3. [SOLVED] Issue with Open, copy, close Macro - when trying to close workbook Clipboard error
    By seanpcorbett1 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 10-13-2016, 05:14 PM
  4. Application Open/Close Event - Store Open and Close Times?
    By mccrimmon in forum Outlook Programming / VBA / Macros
    Replies: 0
    Last Post: 07-13-2011, 04:21 PM
  5. open / close hidden workbook
    By esined in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-19-2011, 09:28 PM
  6. Open hidden workbook on close becomes unhidden
    By Directlinq in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-01-2009, 09:45 AM
  7. [SOLVED] how to close a hidden spreadsheet?
    By Sabine in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 01-25-2006, 05:30 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