MAMIBUSSOL
Board Regular
- Joined
- Jun 2, 2011
- Messages
- 95
Hi
I am using the following code, and would like to put in some error checking.
code being used is:
Sub enterstartdate(startdate)
Do
startdate = InputBox("ENTER STARTDATE AS DD/MM/YYYY ie 01/01/2010", "STARTDATE")
If Len(startdate) = 0 Then Exit Sub
Loop Until IsDate(startdate)
startdate = CDate(startdate)
End Sub
for example
I want to force them to enter a date in the format 01/10/2010 if they enter anything else I want to repeat the request
If they click on the cancel button, I want it to exit the macro
I am using the following code, and would like to put in some error checking.
code being used is:
Sub enterstartdate(startdate)
Do
startdate = InputBox("ENTER STARTDATE AS DD/MM/YYYY ie 01/01/2010", "STARTDATE")
If Len(startdate) = 0 Then Exit Sub
Loop Until IsDate(startdate)
startdate = CDate(startdate)
End Sub
for example
I want to force them to enter a date in the format 01/10/2010 if they enter anything else I want to repeat the request
If they click on the cancel button, I want it to exit the macro