title: Excel VBA Textbox time validation to [h]:mm
body: <p>I am developing a VBA Excel Userform and need to enter a time in the [h]:mm format. This means that the hours can be unlimited and does not cycle back to 0 after 23:59 like the hh:mm format does. I have searched the web to no avail.</p>
  
  <p>Here is the code I'm currently using:</p>
  
  <pre><code>Private Sub Txtbx_TimeAvailable_Exit(ByVal Cancel As MSForms.ReturnBoolean)
      If Me.Txtbx_TimeAvailable.Value &lt;&gt; Format(Me.Txtbx_TimeAvailable.Value, "[h]:mm") Then
          MsgBox "Please enter correct time format in hh:mm"
          Cancel = True
          Me.Txtbx_TimeAvailable.Value = vbNullString
      Else
          ThisWorkbook.Sheets(SELECTEDWORKSHEET).Range("C60").Value = Txtbx_TimeAvailable.Text
          Call UpdateDentistMainForm
      End If
  
  End Sub
  </code></pre>
  
  <p>However, when using this code if I enter 25:53 it converts it to 01:53. I'd appreciate any help I could get on this.</p>