View Single Post
  #7   Report Post  
Posted to microsoft.public.excel.misc
Mike H Mike H is offline
external usenet poster
 
Posts: 11,501
Default Textbox date formatting

It sounds like you have correctly included
Option Explicit
in your code which means all variables must be declared
Try declaring mydate

dim mydate as date

Mike

"capt" wrote:

Sorry,
Here goes:
Compile error
Variable not Defined

with "mydate" highlighted

--
capt


"Mike H" wrote:

perhaps you could share the error message

"capt" wrote:

Sorry that didnt work. I get an error message.
--
capt


"Mike H" wrote:

Maybe

mydate = Date
TextBox15.Value = Format(mydate, "dd-mmm-yy")

Mike

"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