date code

  • Thread starter tkraju via OfficeKB.com
  • Start date
T

tkraju via OfficeKB.com

How to tell a Textbox(on a userform) and the user to enter date value in
"dd/mm/yy" format.
 
T

Tim Zych

Dim v As Variant
Do
v = InputBox("Enter a date")
If StrPtr(v) = 0 Then Exit Sub
Loop While Not IsDate(v)
Me.TextBox1.Text = Format(v, "dd/mm/yy")
 
T

tkraju via OfficeKB.com

Mr.Tim,
Can this code be used for a TextBox in A userform ?
Where are messages ? where to insert the code?
 
T

tkraju via OfficeKB.com

this is not what I want.I want to enter date value in textbox directly in
dd/mm/yy format.Textbox has to accept the date value what I mean entering the
date value.
If I enter today's date as 05/06/08(means 5thJune2008) it should not be
converted into 6thMay2008.
No input box,entry directly in Textbox.
Tim said:
Check out:

http://www.contextures.com/xlUserForm01.html
Mr.Tim,
Can this code be used for a TextBox in A userform ?
[quoted text clipped - 9 lines]
 
T

Tim Zych

Check out

http://www.cpearson.com/excel/newposte.htm

It will help you in constructing a post so that you have a better chance in
getting the response you are looking for.


--
Tim Zych
www.higherdata.com
Compare data in worksheets and find differences with Workbook Compare
A free, powerful, flexible Excel utility


tkraju via OfficeKB.com said:
this is not what I want.I want to enter date value in textbox directly in
dd/mm/yy format.Textbox has to accept the date value what I mean entering
the
date value.
If I enter today's date as 05/06/08(means 5thJune2008) it should not be
converted into 6thMay2008.
No input box,entry directly in Textbox.
Tim said:
Check out:

http://www.contextures.com/xlUserForm01.html
Mr.Tim,
Can this code be used for a TextBox in A userform ?
[quoted text clipped - 9 lines]
How to tell a Textbox(on a userform) and the user to enter date value
in
"dd/mm/yy" format.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top