View Single Post
  #6   Report Post  
Posted to microsoft.public.excel.misc
Dave Peterson Dave Peterson is offline
external usenet poster
 
Posts: 35,218
Default Textbox date formatting

I'd check to see if I had a date first:

Option Explicit
Private Sub TextBox15_BeforeUpdate(ByVal Cancel As MSForms.ReturnBoolean)
If IsDate(Me.TextBox15.Value) Then
Me.TextBox15.Value = Format(Me.TextBox15.Value, "dd-mmm-yy")
End If
End Sub



capt wrote:

I have a userform which has a textbox15 which I have formatted to dd-mmm-yy
by using the following code:

Private Sub TextBox15_BeforeUpdate(ByVal Cancel As MSForms.ReturnBoolean)
TextBox15.Value = Format(TextBox15.Value, "dd-mmm-yy")
End Sub

But it doesnt work....any ideas?
--
capt


--

Dave Peterson