I ask through VBA for starting and end dates and set the value in 2 different cells, my problem is that one value is saved as mm/dd/yy and the other one as dd/mm/yy.
My code is:
Sub DateReport()
Dim StartDate, EndDate As Date
StartDate = InputBox("Report Starting Date (dd/mm/aa)", "Report", Format(Now(), "dd/mm/yy"))
StartDate = Format(CDate(StartDate), "dd/mm/yyyy")
Range("StartReport").Value = StartDate
EndDate = InputBox("Report End Date (dd/mm/aa)", "Report", Format(StartDate, "dd/mm/yy"))
EndDate = Format(CDate(EndDate), "dd/mm/yyyy")
Range("EndReport").Value = EndDate
End Sub
My code is:
Sub DateReport()
Dim StartDate, EndDate As Date
StartDate = InputBox("Report Starting Date (dd/mm/aa)", "Report", Format(Now(), "dd/mm/yy"))
StartDate = Format(CDate(StartDate), "dd/mm/yyyy")
Range("StartReport").Value = StartDate
EndDate = InputBox("Report End Date (dd/mm/aa)", "Report", Format(StartDate, "dd/mm/yy"))
EndDate = Format(CDate(EndDate), "dd/mm/yyyy")
Range("EndReport").Value = EndDate
End Sub