Results 1 to 4 of 4

How do I hide multiple command buttons on one sheet

Threaded View

  1. #1
    Registered User
    Join Date
    09-28-2012
    Location
    PA, US
    MS-Off Ver
    Excel 2003
    Posts
    1

    How do I hide multiple command buttons on one sheet

    I am new to VB in Excel and I need to have several command buttons hidden based on cell values

    I can get this to work with either one if pasted separately but I cannot seem to stack the codes under the worksheet - I would like to be able to hide up to 8 or 9 command buttons based on cell values if possible

    Option Explicit
    
    Private Sub Worksheet_Calculate()
    
    Dim myCell As Range
    Set myCell = Me.Range("q15")
    
    If myCell.Value = 40 Then
    Me.CommandButton5.Visible = True
    Else
    Me.CommandButton5.Visible = False
    End If
    End Sub
    
    ?????????????????????????? not sure how to separate these
    
    Dim myCell As Range
    Set myCell = Me.Range("s12")
    
    If myCell.Value = 0 Then
    Me.CommandButton11.Visible = True
    Else
    Me.CommandButton11.Visible = False
    End If
    End Sub
    Any ideas
    Thanks
    Chris
    Last edited by JBeaucaire; 03-23-2013 at 12:30 PM. Reason: Added CODE tags as per forum rules. Don't forget!

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.6.0 RC 1