title: Hide/Unhide Command Button based on dynamically changing cell value
body: <p>I'd like to create some VBA code that will hide a command button based on a cell's value.</p>
  
  <p>If cell "S17"= "(All)" then the command button should be hidden, otherwise it can remain visible.</p>
  
  <p>As I stated, the value in cell S17 changes dynamically, so the code will need to update whenever the user makes a change.</p>
  
  <p>Here is my code so far:</p>
  
  <pre><code>Private Sub Worksheet_Change(ByVal Target As Range)
   If Sheet3.Range("S17").Value = "(All)" Then
   CommandButton6.Visible = False
  Else
   CommandButton6.Visible = True
  End If
  End Sub
  </code></pre>
  
  <p>Currently this isn't doing anything. If cell S17 = "(All)" the command button is still visible.</p>