Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10,593
Default Check inputbox enter is in correct format

Surely the format isn't important, just whether it is a date or not

Dim ans
ans = InputBox("Please supply date")
If IsDate(ans) Then
Range("A1").Value = Format(ans, "dd/mm/yy")
Else
MsgBox "Invalid date"
End If


--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)

"mcphc" wrote in message
...
How do I check if a users entry into an inputbox is of the format

dd/mm/yyyy.

It would be sufficient to just check that the first 2 characters are
numbers, the third is "/" the fifth and sixth are numbers, etc.



Reply
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
Increase size of a Forms Check Box (click on to enter check mark) 718Satoshi Excel Discussion (Misc queries) 0 August 17th 07 01:52 AM
What's the correct format to check the name of a sheet? Mikke Excel Programming 3 May 18th 06 09:20 PM
Inputbox to enter a % StephanieH Excel Programming 3 April 10th 06 04:00 PM
Check on the input in an inputbox Tempy Excel Programming 5 May 17th 05 02:01 PM
Inputbox to enter date Tom Ogilvy Excel Programming 0 July 27th 04 05:44 PM


All times are GMT +1. The time now is 12:12 AM.

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

About Us

"It's about Microsoft Excel"