+ Reply to Thread
Results 1 to 13 of 13

How do I remove the close button on a userform?

  1. #1
    Forum Contributor
    Join Date
    08-03-2009
    Location
    Cary, NC
    MS-Off Ver
    Excel 2016
    Posts
    109

    How do I remove the close button on a userform?

    I don't want the close button (red X in the upper right corner) to be visible in a userform I'm creating. How do I remove it?

  2. #2
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    16,169

    Re: How do I remove the close button on a userform?

    Hi bishoposiris,

    I think it would be in the "Properties" of the userform. Click on View and show the Properties. I just went through all of them and didn't see how you can remove the close "X" from the form.

    Maybe one of the smart guru's has an answer.
    One test is worth a thousand opinions.
    Click the * Add Reputation below to say thanks.

  3. #3
    Forum Expert
    Join Date
    05-20-2015
    Location
    Chicago, Illinois
    MS-Off Ver
    2016
    Posts
    2,103

    Re: How do I remove the close button on a userform?

    Removing it might be a pain, but if you'd be satisfied with disabling it, then including the following in your userform's code window should work:
    Please Login or Register  to view this content.

  4. #4
    Forum Expert
    Join Date
    08-12-2012
    Location
    Sydney, Australia
    MS-Off Ver
    Excel 2010
    Posts
    5,636

    Re: How do I remove the close button on a userform?

    removing it is actually a pain in the buttock

    i was like Marvin and thought it was in properties though i recall the option may was there in VB6?

    a quick goggle search found
    http://www.ozgrid.com/forum/showthread.php?t=85960

    see attached translated file
    Attached Files Attached Files
    If you are satisfied with the solution(s) provided, please mark your thread as Solved.
    Select Thread Tools-> Mark thread as Solved. To undo, select Thread Tools-> Mark thread as Unsolved.

  5. #5
    Forum Expert jaslake's Avatar
    Join Date
    02-21-2009
    Location
    Atwood Lake in Mid NE Ohio...look it up.
    MS-Off Ver
    Excel 2010 2019
    Posts
    12,749

    Re: How do I remove the close button on a userform?

    Hi bishoposiris

    Here is some Code written by our own Leith Ross that will disable and dim the X (to Close) on a User Form.
    Please Login or Register  to view this content.
    John

    If you have issues with Code I've provided, I appreciate your feedback.

    In the event Code provided resolves your issue, please mark your Thread as SOLVED.

    If you're satisfied by any members response to your issue please use the star icon at the lower left of their post.

  6. #6
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258

    Re: How do I remove the close button on a userform?

    HEllo bishoposiris,

    Add this code to a new VBA Module in your workbook's VBA Project. Call the Sub from your UserForm's Activate event module.

    VBA Module Code
    Please Login or Register  to view this content.
    Userform_Activate() Event Code
    Please Login or Register  to view this content.
    Sincerely,
    Leith Ross

    Remember To Do the Following....

    1. Use code tags. Place [CODE] before the first line of code and [/CODE] after the last line of code.
    2. Thank those who have helped you by clicking the Star below the post.
    3. Please mark your post [SOLVED] if it has been answered satisfactorily.


    Old Scottish Proverb...
    Luathaid gu deanamh maille! (Rushing causes delays!)

  7. #7
    Registered User
    Join Date
    11-09-2018
    Location
    Springfield, MO
    MS-Off Ver
    2016
    Posts
    14

    Re: How do I remove the close button on a userform?

    I need to hide or make the "x" button invisible as well, but I am using a 64 bit operating system.

    I am not familiar enough with VBA to modify the code between 32 bit and 64 bit.

    What do I need to do to make the code work?

  8. #8
    Forum Expert jaslake's Avatar
    Join Date
    02-21-2009
    Location
    Atwood Lake in Mid NE Ohio...look it up.
    MS-Off Ver
    Excel 2010 2019
    Posts
    12,749

    Re: How do I remove the close button on a userform?

    Hi Jessica240
    I've converted some code from 32 bit to 64 bit but am certainly not expert at it. If you were to upload your file with existing code I'll look at it. Your best bet would be to Private Message Lieth Ross and ask him to look at it with you.
    John

  9. #9
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,946

    Re: How do I remove the close button on a userform?

    Quote Originally Posted by Jessica240 View Post
    I need to hide or make the "x" button invisible as well, but I am using a 64 bit operating system.

    I am not familiar enough with VBA to modify the code between 32 bit and 64 bit.

    What do I need to do to make the code work?
    Administrative Note:

    Welcome to the forum.

    We are happy to help, however whilst you feel your request is similar to this thread, experience has shown that things soon get confusing when answers refer to particular cells/ranges/sheets which are unique to your post and not relevant to the original.

    Please see Forum Rule #4 about hijacking and start a new thread for your query.

    If you are not familiar with how to start a new thread see the FAQ: How to start a new thread
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  10. #10
    Forum Expert jaslake's Avatar
    Join Date
    02-21-2009
    Location
    Atwood Lake in Mid NE Ohio...look it up.
    MS-Off Ver
    Excel 2010 2019
    Posts
    12,749

    Re: How do I remove the close button on a userform?

    Sorry, Ford...I don't agree,,, Jessica240's request is right on point...I'd ask you to allow it to proceed.

  11. #11
    Registered User
    Join Date
    11-09-2018
    Location
    Springfield, MO
    MS-Off Ver
    2016
    Posts
    14

    Re: How do I remove the close button on a userform?

    I'm sorry. I am new to using forums and will be cognizant of that rule moving forward. I found a solution to execute the desired events when the red X is clicked by using the queryclose technique. I can leave the button on the form now.

  12. #12
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,946

    Re: How do I remove the close button on a userform?

    Quote Originally Posted by jaslake View Post
    Sorry, Ford...I don't agree,,, Jessica240's request is right on point...I'd ask you to allow it to proceed.
    While Jessica;s question is valid, she did not start this thread, therefor may not ask her question in it - she needs to start her own thread...and then reference this thread if necessary.

  13. #13
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,946

    Re: How do I remove the close button on a userform?

    Quote Originally Posted by Jessica240 View Post
    I'm sorry. I am new to using forums and will be cognizant of that rule moving forward. I found a solution to execute the desired events when the red X is clicked by using the queryclose technique. I can leave the button on the form now.
    No problem and Im happy you found an answer for your question

+ 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. Replies: 1
    Last Post: 01-31-2016, 05:54 AM
  2. Remove UserForm Title Bar and Close Button
    By HangMan in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 10-11-2015, 03:11 PM
  3. How do I remove borders and Close X from a UserForm?
    By ettienero in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 08-21-2013, 09:51 AM
  4. Remove UserForm Borders and Close X
    By HangMan in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 07-17-2011, 12:00 PM
  5. Userform + close button
    By Chip Smith in forum Excel General
    Replies: 2
    Last Post: 04-01-2006, 04:40 AM
  6. Close button userform
    By Excelerate-nl in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 03-23-2006, 07:10 AM
  7. Userform close button
    By Les Stout in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 11-03-2005, 02:45 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