+ Reply to Thread
Results 1 to 5 of 5

Hiding only certain form control buttons on a worksheet

  1. #1
    Forum Contributor
    Join Date
    01-08-2017
    Location
    Salt Lake City, Ut.
    MS-Off Ver
    2019 and 365
    Posts
    135

    Question Hiding only certain form control buttons on a worksheet

    I have a worksheet called Manager with many form control buttons. Most of these are available to the user, but others I do not want the user to see. I know I could hide specific activeX buttons, but have not been able to find any code or a way to hide specific form control buttons.

    Does anyone have any suggestions?

  2. #2
    Forum Contributor frabulator's Avatar
    Join Date
    09-16-2015
    Location
    United States
    MS-Off Ver
    2019
    Posts
    101

    Re: Hiding only certain form control buttons on a worksheet

    Form control button, as in a button inside of a userform?

    _EDIT_

    Never mind, now I know what you are talking about. Give me a second to give you a VBA example.
    Last edited by frabulator; 03-30-2021 at 01:34 PM.

  3. #3
    Forum Contributor
    Join Date
    01-08-2017
    Location
    Salt Lake City, Ut.
    MS-Off Ver
    2019 and 365
    Posts
    135

    Re: Hiding only certain form control buttons on a worksheet

    No, just button form controls placed on a worksheet to initiate various routines, but I am open to any suggestions that may resolve the issue. I have about 20 buttons that are available to the user, and another 12 that previously were hidden when they were ActiveX controls. I have found code that will hide all the buttons, but that does not help. The 12 I want to hide allow access to routines that I do not want the user to see, such as unprotect worksheets, etc.

  4. #4
    Forum Contributor frabulator's Avatar
    Join Date
    09-16-2015
    Location
    United States
    MS-Off Ver
    2019
    Posts
    101

    Re: Hiding only certain form control buttons on a worksheet

    The button properties can be changed through VBA based on the button index number:

    Please Login or Register  to view this content.
    You can loop through the buttons on your worksheet by defining the button number. From there you can pull the properties and see if it is the button you want. For instance, below is a quick macro that will loop through 50 buttons, check to see if the buttons caption matches, and then change that button property to either visible or non visible.

    Please Login or Register  to view this content.

    -EDIT-

    There is probably a more elegant way of doing this, but this method gets the job done.

  5. #5
    Forum Contributor
    Join Date
    01-08-2017
    Location
    Salt Lake City, Ut.
    MS-Off Ver
    2019 and 365
    Posts
    135

    Re: Hiding only certain form control buttons on a worksheet

    Thank you frabulator. Where I went wrong was when assigning the name of the macro, instead of accepting the button number default, I was changing the name of the button. Once I realized that, I recreated the buttons and using your suggestion it works great.

    Thanks again.

+ 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. Form Control Buttons
    By Nickmsi in forum Excel Formulas & Functions
    Replies: 11
    Last Post: 05-23-2017, 04:37 PM
  2. form control command buttons disapear on worksheet
    By Sean Thomas in forum Excel General
    Replies: 6
    Last Post: 02-07-2015, 11:40 AM
  3. Form control buttons creep
    By thecdnmole in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 10-08-2014, 12:59 PM
  4. Adding Form Control Buttons
    By wildlifegis in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 12-15-2012, 01:55 AM
  5. [SOLVED] Hiding/Showing a Form Control with another Form Control
    By SonOfOdin in forum Excel General
    Replies: 2
    Last Post: 06-20-2012, 09:55 AM
  6. Delete Form Control Buttons in a range on worksheet
    By abhiD in forum Excel Programming / VBA / Macros
    Replies: 17
    Last Post: 01-20-2012, 01:38 PM
  7. Replies: 2
    Last Post: 04-22-2005, 09:08 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