title: Vba inputbox excel
body: <p>I have created this investor mail list for work purpose, and need to add some more functions: </p>
  
  <p>I need to "lock" the inputbox, meaning that you have to fill out all the options otherwise an msgbox will occur "Please fill in all the options". </p>
  
  <p>I also need to lock the entire spreadsheet - so it's only possible to add an investor to the mail list through the inputbox. It should only be possible to add an investor without the inputbox through the administrator </p>
  
  <p>I have search all over the internet, and cannot find such functions</p>
  
  <p>Help is much appreciated!</p>
  
  <pre><code>Private Sub OKButton_Click()
  Dim emptyrow As Long
  
  'Make sheet1 active
  Ark1.Activate
  
  'determine emptyrow
  emptyrow = WorksheetFunction.CountA(Range("A:A")) + 1
  
  'Transfer information
  Cells(emptyrow, 1).Value = Email.Value
  Cells(emptyrow, 2).Value = Bank.Value
  Cells(emptyrow, 3).Value = FirstName.Value
  Cells(emptyrow, 4).Value = Surname.Value
  Cells(emptyrow, 5).Value = AddIn.Value
  Cells(emptyrow, 6).Value = TypeComboBox.Value
  
  
  
  If CheckBox1.Value = True Then Cells(emptyrow, 7).Value = CheckBox1.Caption
  
  If CheckBox2.Value = True Then Cells(emptyrow, 7).Value = Cells(emptyrow, 7).Value &amp; " " &amp; CheckBox2.Caption
  
  If CheckBox3.Value = True Then Cells(emptyrow, 7).Value = Cells(emptyrow, 7).Value &amp; " " &amp; CheckBox3.Caption
  
  If CheckBox4.Value = True Then Cells(emptyrow, 7).Value = Cells(emptyrow, 7).Value &amp; " " &amp; CheckBox4.Caption
  
  If CheckBox5.Value = True Then Cells(emptyrow, 7).Value = Cells(emptyrow, 7).Value &amp; " " &amp; CheckBox5.Caption
  
  Unload Me
  
  MsgBox "Investor successfully added"
  
  
  End Sub
  
  Private Sub UserForm_Click()
  
  End Sub
  
  Private Sub UserForm_Initialize()
  
  'empty all textboxes
  
  Email.Value = ""
  Bank.Value = ""
  FirstName.Value = ""
  Surname.Value = ""
  AddIn.Value = ""
  
  TypeComboBox.Clear
  
  'Fill dinnercombobox
  With TypeComboBox
  .AddItem "Bank"
  .AddItem "Corporate"
  .AddItem "DCM"
  .AddItem "Fund Manager"
  .AddItem "FSA"
  .AddItem "Investor"
  .AddItem "Insurance"
  .AddItem "Magazine"
  .AddItem "Other"
  .AddItem "Pension Fund"
  .AddItem "Rating agency"
  
  
  
  End With
  
  'uncheck wishbox
  CheckBox1.Value = False
  CheckBox2.Value = False
  CheckBox3.Value = False
  CheckBox4.Value = False
  
  'set focus on email box
  Email.SetFocus
  
  End Sub
  </code></pre>