I have the following macro below that forces the user to input a Valid month and year in cell A3
When running the macro, the month and year is not inserted
It would be appreciated if someone could kindly assist me
I have posted a similar question on link below
When running the macro, the month and year is not inserted
It would be appreciated if someone could kindly assist me
I have posted a similar question on link below
Incorporate Data Validation in Macro to enter Date
I have the following code below , which allow the user to enter a date in A3 on sheet "WML" I have set up data validation to only accept dates from Aug 2020 to Dec 2099 However, when using the Macro to input the Data, it accepts any data The data validation to be incorporated into...
www.excelforum.com
Code:
Sub DateInput()
Dim strDate As String
Dim myDate As String
Sheets("WML").Select
If Range("A3").Value > Now() Then
Exit Sub
Else
Range("A3").Select
strDate = InputBox("enter the accounting Month and Year eg Aug 2020", "mm/yyyyy")
If IsDate(strDate) Then
strDate = Format(CDate(strDate), "mm/yyyy")
MsgBox strDate
Else
MsgBox "Wrong date format"
End If
End If
End Sub [code]