View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
K Dales[_2_] K Dales[_2_] is offline
external usenet poster
 
Posts: 1,163
Default TextBox Validation - Time Format

Assuming you want to check the value of a String variable (set by the
inputbox) called UserInput, here is one easy way to check:
If (UserInput like "*#:##") And IsDate(UserInput) Then...

(would be a little harder if you wanted to allow am/pm but for "military
time" the above should work)
--
- K Dales


"Zani" wrote:

Wondering if there is a simple solution to this one (I really hope so!). I
am using a serious of userforms to collect data and write it into the
spreadsheet, some of the data to be collected is in Time or Date format. I
have found a way to check the users entries as far as dates go, so they are
forced to enter hh/mm/yy, is there something similar does anybody know that I
can use to check the format of the time entries, ie hh:mm. I'm really
struggling with this one!

I know there are calendar and date pickers but with the number of fields
involved I just wanted to keep it simple - famous last words I know!

Thanks in advance to someone much more clever than I!
--
Zani
(if I have posted here, I really am stuck!)