I would like to only allow the user to enter a date in the inputbox in the format of 'mm-dd-yyyy'. If they do not I want to send msgbox. Here is what I have, just am unsure of how to get the validation.
Code:
Sub Populate_Date()On Error GoTo NotValidInput
Dim myvalue As Date
myvalue = InputBox("Enter Date 'mm-dd-yyyy'", "Date Entry", Date)
Sheets("Inbox Alerts").Range("A1", "B1").Value = myvalue
Sheets("Alert Daily Data").Range("B1").Value = myvalue
Sheets("Alert Daily Data 2").Range("B1").Value = myvalue
Sheets("Alert Daily Data Calculations").Range("B1").Value = myvalue
Exit Sub
NotValidInput:
MsgBox ("You did not enter a correct Date")
End Sub