title: How to pass value from user form to VBA sub
body: <p>I have a simple user form that has only one text box and one button. As user click on the button a message box should display what was typed in </p>
  
  <pre><code>Private Sub CommandButton1_Click()
  Call test
  End Sub
  
  Sub test()
  MsgBox TextBox1.Text
  End Sub 
  </code></pre>
  
  <p>I have two problems : </p>
  
  <p>1) userform is not displayed automatically when i open excel . </p>
  
  <p>2) message box does not show up</p>