LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
YH YH is offline
external usenet poster
 
Posts: 18
Default Validate user input with specific date format

I am new to VBA and not familiar with the syntax. Can someone help me with
the following task?

I have user provide me a date using inputbox(), and I want to verify if the
input date meets the following requirements. If yes, accept the input. If
not, reject the input and loop back to ask for input again.

** Requirements:
1) The input date has to be in mm/dd/yyyy or m/d/yyyy (1/1/2006 for example)
format. If user enters single digit for month and day such as 1/1/2006, the
script will
accept the input and reformat it to mm/dd/yyyy (01/01/20006 for example).

2) The delimiter has to be "/". All other delimiters will be rejected.

3) Reject input if condition 1) and 2) above are not met. Loop back to ask
for user input again.

Any help is greatly appreciated. Thanks!

YH

 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Restrict-Filter-Limit-Validate user input in Excel Dr. Thom Excel Discussion (Misc queries) 0 January 22nd 06 08:06 PM
Input Box Help - Validate Date Format Tbal[_5_] Excel Programming 1 September 6th 05 09:13 PM
TEXTBOX - VALIDATE DATE INPUT Steve_G Excel Programming 3 June 12th 05 04:59 AM
how to format a date/validate for a text box entry on a user form Tom Ogilvy Excel Programming 3 June 1st 05 05:06 PM
How do I make a cell date specific to input a value on a specific. ebuzz13 Excel Discussion (Misc queries) 1 January 18th 05 05:53 PM


All times are GMT +1. The time now is 07:19 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"