dumbitdown
New Member
- Joined
- Jul 23, 2007
- Messages
- 28
Afternoon all,
Looking for a bit of help with looping...
Basically I've created a macro that gets the user to enter data via input boxes and validates the info they have entered, when the format of the info is incorrect I have an error message pop up, when ok is clicked on this error message I want it to loop back round to get them to re-enter the data in the correct format.
I've extracted a bit of the macro to demonstrate (below), how do I make it loop back round to get them to try and enter the data correctly?
Dim strDate As String
strDate = InputBox("Target Date dd/mm/yyyy", "User date", Format(Now(), "dd/mm/yyyy"))
If IsDate(strDate) Then
strDate = Format(CDate(strDate), "dd/mm/yyyy")
MsgBox strDate
Else
MsgBox "Wrong date format"
Any help you can give would be brilliant!
Looking for a bit of help with looping...
Basically I've created a macro that gets the user to enter data via input boxes and validates the info they have entered, when the format of the info is incorrect I have an error message pop up, when ok is clicked on this error message I want it to loop back round to get them to re-enter the data in the correct format.
I've extracted a bit of the macro to demonstrate (below), how do I make it loop back round to get them to try and enter the data correctly?
Dim strDate As String
strDate = InputBox("Target Date dd/mm/yyyy", "User date", Format(Now(), "dd/mm/yyyy"))
If IsDate(strDate) Then
strDate = Format(CDate(strDate), "dd/mm/yyyy")
MsgBox strDate
Else
MsgBox "Wrong date format"
Any help you can give would be brilliant!