+ Reply to Thread
Results 1 to 7 of 7

How to have open a hidden sheet / hide on closing

  1. #1
    Registered User
    Join Date
    01-17-2014
    Location
    In a house, I think.
    MS-Off Ver
    Excel 2010 I think
    Posts
    12

    How to have open a hidden sheet / hide on closing

    Hey everyone;
    I've got this function where you can select from a list of names, and when you press go it unhides the sheet and goes to it, probel with that was after closing the sheet it was no longer hidden...
    So now, I have
    Please Login or Register  to view this content.
    So when you press go, it unhides the sheet, goes to it, and hides it again, but then the sheet is hidden it pushes the user back to the page they was on, so it would appear you can't have a hidden sheet open.
    Is there a way for excel to determine when the sheet has been closed, to be able to hide it when the user navigates away?

  2. #2
    Forum Contributor
    Join Date
    07-27-2012
    Location
    California, USA
    MS-Off Ver
    Excel 2003
    Posts
    198

    Re: How to have open a hidden sheet / hide on closing

    I use Excel 2003 so I hope this tip applies to your situation.
    A macro in the "home" worksheet's module can tell you when a user
    has been directed back to or has navigated to the home sheet.

    At that point, if the combo box has a value and the sheet for that value was
    unhidden, it can be hidden.

    Please Login or Register  to view this content.
    Last edited by xLJer; 02-25-2014 at 11:44 PM.

  3. #3
    Registered User
    Join Date
    01-17-2014
    Location
    In a house, I think.
    MS-Off Ver
    Excel 2010 I think
    Posts
    12

    Re: How to have open a hidden sheet / hide on closing

    Thanks man, really appreciate the help
    +rep

  4. #4
    Registered User
    Join Date
    01-17-2014
    Location
    In a house, I think.
    MS-Off Ver
    Excel 2010 I think
    Posts
    12

    Re: How to have open a hidden sheet / hide on closing

    So I've been fiddling with this for a while;

    If there's a sheet called "Sheet1" it works fine, but I have a sheet called Interface and it doesn't make the messagebox appear...
    It's retarded, but I even tried changing what appears in the msgbox, and i tried changing it to Interface_Activate()
    any suggestions to make it work with a sheet called "Interface"?

  5. #5
    Forum Contributor
    Join Date
    07-27-2012
    Location
    California, USA
    MS-Off Ver
    Excel 2003
    Posts
    198

    Re: How to have open a hidden sheet / hide on closing

    The VBA code I posted does not depend on a sheet name. Whatever sheet
    you decide to use for your "home" worksheet, whether it's named Sheet1 or Interface,
    it should work.

    Activate your home sheet. I assume you know how to get to that worksheet's code module.
    With Excel 2003 I right-click the tab with the active sheet name (at the bottom of the screen)
    and choose 'View Code'.
    Then in VBA editor mode you add a sub routine, like I did, to run every time the home
    sheet is activated. If there is nothing selected in the combo box, then you exit
    the routine. If a combo item has been selected, then you test the specific worksheet
    for that item to see if the sheet is visible. If it is visible, you hide it.

    If you can't get this to work, post your VBA code, using the hash tag icon to display your code,
    as this forum requires.

  6. #6
    Registered User
    Join Date
    01-17-2014
    Location
    In a house, I think.
    MS-Off Ver
    Excel 2010 I think
    Posts
    12

    Re: How to have open a hidden sheet / hide on closing

    So I want to have 2 buttons, one controlled by a combo box that allows users to select a sheet to view, it unhides it and when they return it's hidden again.
    I tried to hide the Sheet "Student Details" and it did work but it had a debug error, I changed something, went for lunch and when I got back it wasn't working at all and I cannot remember what I changed

    I know the code is a messy atrocity... sorry
    I really appreciate the help you're giving

    Please Login or Register  to view this content.

  7. #7
    Forum Contributor
    Join Date
    07-27-2012
    Location
    California, USA
    MS-Off Ver
    Excel 2003
    Posts
    198

    Re: How to have open a hidden sheet / hide on closing

    An Excel 2003 workbook is attached for you to try out.
    I'm not sure how you are applying 2 combo boxes, so I've
    only used one plus a command button to view the worksheet.
    See if the code helps you to work out your bugs.

    I've included code to clear out and reset the combo,
    and hide any sheets that should be hidden,
    each time the workbook is opened, in case the user
    saved and closed the file before activating Sheet1.

    Here is all the code from the attachment.
    Add a new module and put this code in it:
    Please Login or Register  to view this content.
    Code from the Sheet1 worksheet module:

    Please Login or Register  to view this content.
    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. VBA to open a hidden sheet
    By ScottBeatty in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 07-10-2013, 11:53 AM
  2. Macro to hide hidden cells from functions in another sheet in same workbook
    By StephanieLilly in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 03-05-2013, 10:59 AM
  3. [SOLVED] Go to a specific sheet if the sheet to open in the macro is hidden?
    By darrenkaye in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 02-20-2013, 03:45 PM
  4. [SOLVED] how 2 hide row if row in another sheet is hidden?
    By xz in forum Excel General
    Replies: 1
    Last Post: 02-26-2006, 02:25 PM
  5. print hidden sheet, then hide again
    By as_sass in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 02-09-2005, 04:36 PM

Tags for this Thread

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