+ Reply to Thread
Results 1 to 3 of 3

Thread: Hiding command buttons

  1. #1
    Registered User
    Join Date
    12-19-2011
    Location
    South Africa
    MS-Off Ver
    Excel 2007
    Posts
    11

    Hiding command buttons

    Hi guys,
    im looking for a macro that can hide/show command buttons in 2007. and how do you find the name of the command button to put into the code? i cant find its variable name anywhere???

    Thanks for the help

  2. #2
    Valued Forum Contributor john55's Avatar
    Join Date
    10-23-2010
    Location
    Europe
    MS-Off Ver
    Excel 2007
    Posts
    825

    Re: Hiding command buttons

    if you want to hide/show a commandbutton you can try this option:
    Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean)
    If Not Intersect(Target, Range("d1")) Is Nothing Then
    CommandButton5.Visible = True  'double click in cell d1 and yr commandbutton appears
    End If
    If Not Intersect(Target, Range("d2")) Is Nothing Then
    CommandButton5.Visible = False  ''double click in cell d2 and yr commandbutton disappears
    
    End If
    Regards, John

  3. #3
    Valued Forum Contributor OnErrorGoto0's Avatar
    Join Date
    12-30-2011
    Location
    I DO NOT POST HERE ANYMORE
    MS-Off Ver
    I DO NOT POST HERE ANYMORE
    Posts
    1,647

    Re: Hiding command buttons

    To discover the name, you need to click on the Design mode button on the developer tab, then select the button and the name will appear in the Name box.
    Good luck.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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.2.0