+ Reply to Thread
Results 1 to 2 of 2

Hide/Unhide Command Button using CheckBox

Hybrid View

  1. #1
    Registered User
    Join Date
    08-04-2009
    Location
    Oxford, England
    MS-Off Ver
    Excel 2010
    Posts
    47

    Hide/Unhide Command Button using CheckBox

    Hi

    I want to create a Macro for 30 checkboxes to hide a respective number Command button and I have tried with one but am having no luck with the coding below (it's very basic)

    Sub CheckBox15_Click()
    If CheckBox15.Value = True Then
    ActiveSheet.Shapes("Button17").Visible = True
    Else
    ActiveSheet.Shapes("Button17").Visible = False
    End If

    End Sub

    Could someone help as to how I get a single checkbox to hide and unhide a command button when the checkbox is checked/unchecked

    Thanks

    Daniel

  2. #2
    Forum Expert
    Join Date
    02-11-2014
    Location
    New York
    MS-Off Ver
    Excel 365 (Windows)
    Posts
    6,289

    Re: Hide/Unhide Command Button using CheckBox

    This worked for me, using ActiveX controls:

    Private Sub CheckBox15_Click()
    ActiveSheet.Shapes("Button17").Visible = ActiveSheet.CheckBox15.Value
    End Sub
    Bernie Deitrick
    Excel MVP 2000-2010

+ 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. Command Button - Hide and Unhide Sheet VBA
    By Kimber20 in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 03-09-2014, 11:06 AM
  2. Using command button to hide/unhide worksheets
    By Sly1980 in forum Excel General
    Replies: 1
    Last Post: 05-31-2012, 03:44 PM
  3. Command button to Hide a tab and unhide a tab with a password
    By nik63 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 02-08-2011, 07:24 PM
  4. Hide/Unhide Combo box via command button
    By staples in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 10-20-2009, 06:15 AM
  5. Command Button to Hide/Unhide Rows
    By Bea in forum Excel General
    Replies: 4
    Last Post: 03-16-2006, 11:21 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