title: Disable button on a userForm
body: <p>I'm trying to figure out how to disable a button within my userForm if a certain cell within my spreadsheet equals a certain number.  I tried the code stated below, but it isn't working.</p>
  
  <pre><code>Private Sub UserForm_Initialize()
  Label2 = Sheets("DATA").Range("AM2").Value
  Label4 = Sheets("DATA").Range("AO2").Value
  Label7 = Format(Sheets("DATA").Range("R8").Value, "Currency")
  
  If Sheets("DATA").Range("AL10").Value = 10 Then
  ActiveSheet.Shapes("CommandButton1").Select
  UserFormact_Upgrade.CommandButton1.Enabled = False
  
  Else
  
  
  End If
  
  End Sub
  </code></pre>