+ Reply to Thread
Results 1 to 5 of 5

Control Button disappear when criteria met

  1. #1
    Forum Contributor
    Join Date
    01-25-2021
    Location
    Atlanta, Georgia
    MS-Off Ver
    365
    Posts
    144

    Control Button disappear when criteria met

    I have a sheet with names, months and if "Met?" (criteria). Next to each entry row, active control buttons are available for user to click to erase Name and Month if met. (The "Met" column has formulas build in but is not relevant to this inquiry).

    I am looking for a code to make the Control button only visible if criteria met (If "Yes" indicated) and disappear if criteria not met. Also if made visible, button on each row should erase data in columns A & B of subsequent row. I began below code but it only addresses first part of my request and also does not work !!

    Please Login or Register  to view this content.
    Moderator's note: Please take the time to review our rules. There aren't many, and they are all important. Rule #2 requires code tags. I have added them for you this time because you are a new member. --6StringJazzer


    Thanks kindly to anyone offering solution:
    Attached Files Attached Files
    Last edited by 6StringJazzer; 02-15-2022 at 10:24 PM.

  2. #2
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,436

    Re: Control Button disappear when criteria met

    I've used a UDF (user defined function) rather than worksheet_change event

    each row gets a formula with the name of the button on that row.

    =udfSHOWBUTTON(UPPER(C2)="YES","Button 1")

    assign this macro to all buttons

    Please Login or Register  to view this content.
    Attached Files Attached Files
    Cheers
    Andy
    www.andypope.info

  3. #3
    Forum Contributor
    Join Date
    01-25-2021
    Location
    Atlanta, Georgia
    MS-Off Ver
    365
    Posts
    144

    Re: Control Button disappear when criteria met

    Thanks Andy. Your solution on the sample sheet is exactly what I needed!! But I can't seem to duplicate your steps in my actual sheet. A couple of questions:

    1. What is the purpose of the additional Module (Module 2) Option Explicit?
    2. You suggested to add formula with name of the button on that particular row. Where would I add the formula since I could not see how you did it on your sample sheet?

  4. #4
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,436

    Re: Control Button disappear when criteria met

    1. Not required. Can be deleted.
    2, Formula is in column D. To get name of button check Name Box, to left of formula bar, when selected. Or use Selection pane (ALT+F10)

  5. #5
    Forum Contributor
    Join Date
    01-25-2021
    Location
    Atlanta, Georgia
    MS-Off Ver
    365
    Posts
    144

    Re: Control Button disappear when criteria met

    Wow....this is amazing. It worked splendidly. Much appreciation Andy Pope!

+ 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: 02-27-2017, 09:17 AM
  2. Cant get MSGBOX to disappear after clicking on the OK button.
    By welchs101 in forum Excel Programming / VBA / Macros
    Replies: 18
    Last Post: 07-11-2012, 09:59 AM
  3. ActveX Control Button Not Working But Form Control Button is
    By MikeTruth in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 05-31-2012, 05:04 AM
  4. Making a button disappear after clicking on it...
    By ssedha in forum Excel Programming / VBA / Macros
    Replies: 15
    Last Post: 04-26-2012, 01:50 PM
  5. Control boxes disappear after opening sheet
    By Jim Eastridge in forum Excel General
    Replies: 2
    Last Post: 11-13-2006, 06:09 PM
  6. Control toolbox Buttons disappear on click
    By Mangesh Yadav in forum Excel General
    Replies: 2
    Last Post: 09-16-2005, 01:05 AM
  7. Make a button disappear
    By Aaron Howe in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 06-22-2005, 12:05 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