Hi,

Part of one of my macros puts data validation in a range of my cells. The validation is dates between 1/1/2013 and date(year(now()),12,31. I am wondering how to express the formula in the error alert. Here's what I have so far for my code, with where I need help highlighted in red:


Range("A6:B10000").Select
With Selection.Validation
.Delete
.Add Type:=xlValidateDate, AlertStyle:=xlValidAlertStop, Operator:= _
xlBetween, Formula1:="1/1/2013", Formula2:="=date(year(now()),12,31)"
.IgnoreBlank = True
.InCellDropdown = True
.InputTitle = ""
.ErrorTitle = "Invalid Date"
.InputMessage = ""
.ErrorMessage = "You have entered an invalid date. Please enter a date between 1/1/2013 and date(year(now(),12,31)."
.ShowInput = True
.ShowError = True
End With


Thanks all for your help.