+ Reply to Thread
Results 1 to 13 of 13

How to hide and show userform and werksheet with Toggle Nutton and Command Button

  1. #1
    Registered User
    Join Date
    02-25-2017
    Location
    Bloemfontein South Africa
    MS-Off Ver
    2019
    Posts
    56

    How to hide and show userform and werksheet with Toggle Nutton and Command Button

    Hi
    I am currently having problems to Show and Hide UserForm and worksheet properly. When I open the workbook everything works fine. The Userorm opens and the Worksheet is hidden as I want it. When I click the Show Worksheet the worksheet appears. However when I click the Close UserForm the UserForm and Worksheet disappears completely!

    I am very new to VBA.

    Here is the code I am using:

    Please Login or Register  to view this content.
    Thanx
    Last edited by DawidV; 02-26-2017 at 07:17 AM. Reason: To add Code Tags to code

  2. #2
    Forum Expert Keebellah's Avatar
    Join Date
    01-12-2014
    Location
    The Netherlands
    MS-Off Ver
    Office 2021 (Windows)
    Posts
    7,905

    Re: How to hide and show userform and werksheet with Toggle Nutton and Command Button

    Hi, good morning and welcome to the forum,

    Could you attach a sample file (non private data please), will make it easier to see what is wrong. Your code doesn't tell me all.
    ---
    Hans
    "IT" Always crosses your path!
    May the (vba) code be with you... if it isn't; start debugging!
    If you like my answer, Click the * below to say thank-you

  3. #3
    Registered User
    Join Date
    02-25-2017
    Location
    Bloemfontein South Africa
    MS-Off Ver
    2019
    Posts
    56

    Re: How to hide and show userform and werksheet with Toggle Nutton and Command Button

    Quote Originally Posted by Keebellah View Post
    Hi, good morning and welcome to the forum,

    Could you attach a sample file (non private data please), will make it easier to see what is wrong. Your code doesn't tell me all.
    Hi

    Thanx. I am very very new to using Forums for help.

    Could u please help me with what you want me to send you. specially the how part? I have no idea how to do thet.

    Thanx

  4. #4
    Forum Expert Keebellah's Avatar
    Join Date
    01-12-2014
    Location
    The Netherlands
    MS-Off Ver
    Office 2021 (Windows)
    Posts
    7,905

    Re: How to hide and show userform and werksheet with Toggle Nutton and Command Button

    You must send me the file you are working with, I cannot imagine or guess what YOU have.
    Just attach the file, If you read the forum's instructions. it is all told there.

    I have attached a file explaining it a little
    Attached Files Attached Files
    Last edited by Keebellah; 02-25-2017 at 11:10 AM. Reason: forgot attachment

  5. #5
    Registered User
    Join Date
    02-25-2017
    Location
    Bloemfontein South Africa
    MS-Off Ver
    2019
    Posts
    56

    Re: How to hide and show userform and werksheet with Toggle Nutton and Command Button

    Ok.

    Thanx will try to attach the complete file.

    If you want plse give me an email address. It will be easier to communicate. I will not abuse the privilege that i have that
    are willing to assist me.

    Thanx

    Dawid
    Attached Files Attached Files

  6. #6
    Forum Expert Keebellah's Avatar
    Join Date
    01-12-2014
    Location
    The Netherlands
    MS-Off Ver
    Office 2021 (Windows)
    Posts
    7,905

    Re: How to hide and show userform and werksheet with Toggle Nutton and Command Button

    Let me take a look first. I'll let you know

  7. #7
    Forum Expert
    Join Date
    12-14-2012
    Location
    London England
    MS-Off Ver
    MS 365 Office Suite.
    Posts
    8,448

    Re: How to hide and show userform and werksheet with Toggle Nutton and Command Button

    Sorry All.

    Please ensure that you use code tags.


    Your post does not comply with Rule 3 of our Forum RULES. Use code tags around code.




    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, it also maintains VBA formatting.

    Click on Edit to open your thread, then highlight your code and click the # icon at the top of your post window. More information about these and other tags can be found here

    (This thread should receive no further responses until this moderation request is fulfilled, as per Forum Rule 7)
    My General Rules if you want my help. Not aimed at any person in particular:

    1. Please Make Requests not demands, none of us get paid here.

    2. Check back on your post regularly. I will not return to a post after 4 days.
    If it is not important to you then it definitely is not important to me.

  8. #8
    Registered User
    Join Date
    02-25-2017
    Location
    Bloemfontein South Africa
    MS-Off Ver
    2019
    Posts
    56

    Re: How to hide and show userform and werksheet with Toggle Nutton and Command Button

    Hi
    I am currently having problems to Show and Hide UserForm and worksheet properly. When I open the workbook everything works fine. The Userorm opens and the Worksheet is hidden as I want it. When I click the Show Worksheet the worksheet appears. However when I click the Close UserForm the UserForm and Worksheet disappears completely!

    I am very new to VBA.

    Here is the code I am using:

    Please Login or Register  to view this content.
    Thanx

  9. #9
    Forum Expert Keebellah's Avatar
    Join Date
    01-12-2014
    Location
    The Netherlands
    MS-Off Ver
    Office 2021 (Windows)
    Posts
    7,905

    Re: How to hide and show userform and werksheet with Toggle Nutton and Command Button

    This should do it
    Attached Files Attached Files

  10. #10
    Registered User
    Join Date
    02-25-2017
    Location
    Bloemfontein South Africa
    MS-Off Ver
    2019
    Posts
    56

    Re: How to hide and show userform and werksheet with Toggle Nutton and Command Button

    Thanx a mill!!

    It is working as I wanted it to work!!!!

    I looked at the code and I take it the change was made to the [CODE]UserForm_Terminate()[CODE] proc?

    Always thought I did/forgot something in the code or did something stupid!!!!!!! Am so new to this that I find it very difficult to figure out what does what when I try to go through the code later on.

    Am still trying to figure out a way to go through the code step by step and seeing what it does. Maybe debug???

    What I am trying to say is I am looking for a way to maybe go step by step through the program to see if it does what it must do. Don't know if I am explaining myself properly here.

    Again thanx for the help. As you can see in the code there is still a lot to be done so you do know that i will be coming back to u again.......

    Greetings for now

  11. #11
    Forum Expert Keebellah's Avatar
    Join Date
    01-12-2014
    Location
    The Netherlands
    MS-Off Ver
    Office 2021 (Windows)
    Posts
    7,905

    Re: How to hide and show userform and werksheet with Toggle Nutton and Command Button

    If you want to go though the code step-by-step.
    Open VBA editor and select the macro then press F8
    Your first mistake was in making the application FALSE after closing the userform it hides it an your userform is gone too

  12. #12
    Registered User
    Join Date
    02-25-2017
    Location
    Bloemfontein South Africa
    MS-Off Ver
    2019
    Posts
    56

    Re: How to hide and show userform and werksheet with Toggle Nutton and Command Button

    Ok thanx.

    I will now be able to carry on again. will post again if i get stuck.

    Will do as you advise to view step by step.

  13. #13
    Forum Expert Keebellah's Avatar
    Join Date
    01-12-2014
    Location
    The Netherlands
    MS-Off Ver
    Office 2021 (Windows)
    Posts
    7,905

    Re: How to hide and show userform and werksheet with Toggle Nutton and Command Button

    Good to hear, I'm sure you can do it
    You know where to find us / me.

+ 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] Need macro to show or hide columns using a command button
    By Grilleman in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-30-2016, 08:59 AM
  2. [SOLVED] Toggle Button -Show Hide Column Range Fails
    By sl729 in forum Excel General
    Replies: 5
    Last Post: 05-22-2016, 09:17 PM
  3. Use a Shape as a Toggle Button to Show and Hide a Worksheet
    By HangMan in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 11-19-2015, 09:49 AM
  4. Show/Hide Rows & Columns Toggle Button
    By axegrynder in forum Excel General
    Replies: 2
    Last Post: 06-29-2015, 06:38 PM
  5. [SOLVED] Hide Show Excel Toolbars using a Toggle Button
    By HangMan in forum Excel Programming / VBA / Macros
    Replies: 16
    Last Post: 07-11-2012, 05:11 PM
  6. VBA hide row based on pull down with button to toggle show/hide
    By myronr in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 06-12-2012, 06:07 PM
  7. command button on/off (show/hide)
    By gobbolino in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 05-13-2007, 10:35 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