title: Excel VBA password protect a command button
body: <p>I've got a very large and somewhat fragile spreadsheet that I'm working on, and I'd like to limit access to more complicated macros--ones that delete or add data. I'm less worried about security than I am about someone who doesn't know what they're doing deleting unfortunate things. I've used the 'inputbox' password trick, but it becomes slightly annoying to have to keep putting in the password over and over. Is there any way to have the macro 'remember' that I put in the password once, and then reset after I close the sheet, without storing it in a cell somewhere?</p>
  
  <p>Here's the code I'm currently using:</p>
  
  <pre><code>Sub ControlPanel()
  
  Dim PassProtect As Variant
  
  PassProtect = InputBox(Prompt:="Please enter the password to unlock the updater." &amp; vbCrLf &amp; "(Case Sensitive)", Title:="Control Panel")
  
    If PassProtect = vbNullString Then Exit Sub
  
  If PassProtect = "password" Then
      ControlPanelForm.Show vbModeless    
  Else: MsgBox Prompt:="Incorrect password. Please try again.", Buttons:=vbOKOnly
  End If
  
  End Sub
  </code></pre>
  
  <p>Thanks!</p>