title: textbox date format excel vba
body: <p>I have a code that allows me to manually enter date in textbox1 which then gets selected in the calendar on the useform. There is a second textbox that allows me to add or subtract dates. The code works perfectly.</p>
  
  <p>Userform Code -</p>
  
  <pre><code>Option Explicit 
  Private Sub TextBox1_Exit(ByVal Cancel As MSForms.ReturnBoolean) 
      If IsDate(Me.TextBox1.Value) Then Me.Calendar1.Value = Me.TextBox1.Value 
  End Sub 
  Private Sub TextBox2_Exit(ByVal Cancel As MSForms.ReturnBoolean) 
      Dim dt As Date 
      With Me 
          If IsDate(.TextBox1.Value) Then 
              dt = CDate(.TextBox1.Value) + Val(.TextBox2.Value)
              .TextBox1.Value = dt 
              .Calendar1.Value = dt
          End If 
      End With 
  End Sub 
  </code></pre>
  
  <p>I would like to manually enter date in textbox1 in a specific format.</p>
  
  <p>The formats will be -</p>
  
  <p>dd</p>
  
  <p>ddmmm</p>
  
  <p>ddmmmyyy</p>
  
  <p>I'm not sure how to write a code that does this.</p>
  
  <p>The idea is to enter date in either of the 3 formats specified above in textbox1, which then gets selected on the calendar on the userform.</p>