I am looking to update this existing code to prompt for a date to fill down column A. I want it to only except a valid date in mm/dd/yy format. Below is code that works at filling down, but accepts dates that are invalid (ie. 10/35/16). Thanks in advance for the help!
Code:
Sub MySub()
Dim strAnswer As String
Dim rngToFill As Range
Dim lastrow As Long
lastrow = Range("B" & Rows.Count).End(xlUp).Row
Columns("A:A").Insert Shift:=xlToRight, _
CopyOrigin:=xlFormatFromLeft
[A1].Formula = "asof_dt"
Set rngToFill = Range("A2", Range("A2:A" & lastrow)).Offset(, 0)
strAnswer = InputBox("Please enter an asof_dt for this file in the following format: MM/DD/YY")
If Len(strAnswer) = 0 Then Exit Sub
rngToFill = strAnswer
Columns.AutoFit
End Sub