+ Reply to Thread
Results 1 to 5 of 5

Issue with command button unhiding sheets

  1. #1
    Registered User
    Join Date
    01-29-2024
    Location
    USA
    MS-Off Ver
    365
    Posts
    6

    Issue with command button unhiding sheets

    Please Login or Register  to view this content.
    [/CODE]
    Please Login or Register  to view this content.
    I am having an issue with a command I am using,
    I have a bunch of command buttons on my main sheet where each is used unhide one single specified sheet, however they don't always work. The goal of this button is to simply unhide the tab the sheet it referring to, but not go to that sheet yet...
    Sometimes some of them will work in 1 click, sometimes it will finally work after 3 or 4 clicks, and sometimes not at all. It seems random when they work and when they don't.

    Oddly, They will almost always work if I click it once and then Push the space bar right after.

    Is there a problem with my formula below? or is there a way to tell automatically execute a space bar push afterwards? or to get it to always execute the command? any ideas? (side note, I tried changing to "True" to "xlSheetVisible") which didn't seem to help.

    Please Login or Register  to view this content.

    I also have the below command buttons for unhiding and going to the indicated worksheet, and these buttons always work fine.

    Please Login or Register  to view this content.
    Thanks!
    Last edited by zbor; 01-29-2024 at 10:30 AM.

  2. #2
    Forum Moderator zbor's Avatar
    Join Date
    02-10-2009
    Location
    Croatia
    MS-Off Ver
    365 ProPlus
    Posts
    15,626

    Re: Issue with command button unhiding sheets

    Please take a moment to add the tags. Posting code between [code]Please [url=https://www.excelforum.com/login.php]Login or Register [/url] to view this content.[/code] tags makes your code much easier to read and copy for testing, and it also maintains VBA formatting.
    I've done it now for you.

    If selecting sheet work maybe you could select active cell.

    Please Login or Register  to view this content.
    Thus you won't change selection

  3. #3
    Registered User
    Join Date
    01-29-2024
    Location
    USA
    MS-Off Ver
    365
    Posts
    6

    Re: Issue with command button unhiding sheets

    Thank you!

    I have tried adding this but unfortunately I am still having to press the space bar after I click on the button for it to unhide the sheet.

  4. #4
    Registered User
    Join Date
    01-29-2024
    Location
    USA
    MS-Off Ver
    365
    Posts
    6

    Re: Issue with command button unhiding sheets

    ok, Since the second code I had for unhiding and going to the worksheet always works, I decided to try the below; essentially to go to the worksheet, then go back to the sheet i was on; I added screen updating so you don't see it flashing between screens. seems to be working, at least better than before.

    Now I am wondering if i can add a test first to test if the wkst is hidden and if so execute the command, but if it is already unhidden I want it to do nothing. DO you know how to do this?

    Please Login or Register  to view this content.
    Last edited by Oakley 0226; 01-29-2024 at 11:58 PM.

  5. #5
    Forum Moderator zbor's Avatar
    Join Date
    02-10-2009
    Location
    Croatia
    MS-Off Ver
    365 ProPlus
    Posts
    15,626

    Re: Issue with command button unhiding sheets

    Try:

    Please Login or Register  to view this content.

+ 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. ActiveX Textbox and Command button issue
    By kevinlib in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 04-22-2021, 02:33 PM
  2. [SOLVED] Issue with trying to pass name of command button as a variable
    By smk224 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-02-2018, 11:08 AM
  3. [SOLVED] Save button unhiding hidden sheets
    By Nitro2481 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 06-20-2016, 08:51 AM
  4. VBA code to create command button. Print all sheets then delete command button.
    By Declamatory in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 11-15-2015, 05:18 PM
  5. Macro/Command button - cell reference issue?
    By mhblake in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-28-2012, 02:41 PM
  6. VBA Userform Issue - Command Button / msg Box
    By teeks in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 01-07-2010, 11:37 AM
  7. Replies: 0
    Last Post: 11-03-2005, 11:00 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