Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Hi
I have a user entry form and need to ensure the correct data format is used when entering. At the moment it is a text box on a VBA data entry form, I want to code the text box to only accept dd/mm/yy format. -- thanks Roy |
#2
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
If you get the dat as a string, then you can perform very specific tests on
parts of that string. For example: Sub StrictFormat() Dim s As String, i As Integer s = Application.InputBox(prompt:="Date?", Type:=2) If Len(s) < 8 Then MsgBox "Bad Format" Exit Sub End If ary = Split(s, "/") If UBound(ary) < 2 Then MsgBox "Bad Format" Exit Sub End If i = ary(0) If i 31 Then MsgBox "Bad Format" Exit Sub End If i = ary(1) If i 12 Then MsgBox "Bad Format" Exit Sub End If End Sub -- Gary''s Student - gsnu201001 "Roy Gudgeon" wrote: Hi I have a user entry form and need to ensure the correct data format is used when entering. At the moment it is a text box on a VBA data entry form, I want to code the text box to only accept dd/mm/yy format. -- thanks Roy |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
how to format data with an input mask like ss# (***-**-****) | New Users to Excel | |||
Input data format from GIS | Excel Discussion (Misc queries) | |||
How do I add input data in the input ranges in drop down boxes. | Excel Discussion (Misc queries) | |||
format cell from data input to output form | Excel Worksheet Functions | |||
what is the format for an input cell? | Excel Discussion (Misc queries) |