iggydarsa
Well-known Member
- Joined
- Jun 28, 2005
- Messages
- 1,780
- Office Version
- 2019
- Platform
- Windows
Hi everyone,
I have a code looks like this:
For startDate I entered 2/1/05 and msgbox outputted "2-Jan-05" which is fine but after that for stopDate I entered 19/2/05 and msgbox outputted "2-May-19" which is wrong, it should be "19-Feb-05".
What am I doing wrong?
Any suggestions?
Thanks
I have a code looks like this:
Code:
Sub DateOutput()
Dim startDate As String
Dim stopDate As String
startDate = InputBox("Start Date: (dd/mm/yy)")
startDate = Format(startDate, "dd/mm/yy")
stopDate = InputBox("Stop Date: (dd/mm/yy)")
stopDate = Format(stopDate, "dd/mm/yy")
MsgBox Format(startDate, "dd-mmm-yy")
MsgBox Format(stopDate, "dd-mmm-yy")
End Sub
For startDate I entered 2/1/05 and msgbox outputted "2-Jan-05" which is fine but after that for stopDate I entered 19/2/05 and msgbox outputted "2-May-19" which is wrong, it should be "19-Feb-05".
What am I doing wrong?
Any suggestions?
Thanks