jocker_boy
Board Regular
- Joined
- Feb 5, 2015
- Messages
- 83
Hello,
I have this code, but i would like the user to only input date in this format: "mm/yy" and ignore entering the day. But i need to assume always day 01.
For example:
User insert: 10/22
And the date will appear: 01/10/22 (dd/mm/yy).
Thanks,
Gonçalo
I have this code, but i would like the user to only input date in this format: "mm/yy" and ignore entering the day. But i need to assume always day 01.
For example:
User insert: 10/22
And the date will appear: 01/10/22 (dd/mm/yy).
Thanks,
Gonçalo
VBA Code:
'Project Dates
Dim strDate As String
Dim LastMonth As Long
'Insert First Date
strDate = InputBox("Insert start of the project (mm/dd/yy)", "Enter Date", Format(Date, "dd/mm/yy"))
If IsDate(strDate) Then
strDate = Format(CDate(strDate), "dd/mm/yy")
Else
MsgBox "Wrong date format"
End If