Is there a way to create a MsgBox that disables a Sheet until a date is entered?
Imputing a date using a MsgBox
-
-
-
Here's another way.
Code
Display MoreSub GetDate() Dim oWs As Worksheet Dim vDte As Variant Set oWs = Sheets("your_sheet_name _here") TryAgain: With oWs ''/// enter your required date format vDte = InputBox("Please Enter the Date *Must be format mm/dd/yyyy*", "Enter Date") If vDte = "" Then MsgBox ("You did not enter a date!"), vbCritical, "INPUT ERROR" GoTo TryAgain ''/// this will force a retry ''/// check that a date has been entered If Not IsDate(vDte) Then MsgBox ("You did not enter the correct format!"), vbCritical, "INPUT ERROR" GoTo TryAgain End If Else ''enters date to A1 oWs.Range("A1").Value = CDate(vDte) End If End With End Sub
-
Thank You for all the info
-
Pleased to help.
Post back if you need further help.
Visit my web site, http://www.excel-it.com, for more examples and some helpful articles.
-
Participate now!
Don’t have an account yet? Register yourself now and be a part of our community!