I have a column with data validation that currently limits the maximum number of characters a user can input to just 20. However, I would also like to include another limitation where the characters entered must be uppercase if they are alphabets. I'm assuming I would have to use a "Custom" data validation? If so, can anyone help me with the formula that would apply to the data in the entire column instead of just the selected cell(s)?
Lastly, I'm trying to change the error message that would display when the user does not meet the conditions defined, but I keep getting the default Microsoft Excel error message that pops up. How do I change the error message box to display a custom message of my choosing?
Dim shTemp As Worksheet: Set shTemp = ThisWorkbook.Sheets("Template")
With shTemp.Range("G2:G" & shTemp.Range("G" & Rows.Count).End(xlUp).Row).Validation
.Add Type:=xlValidateTextLength, AlertStyle:=xlValidAlertStop, Operator:=xlLessEqual, Formula1:="20"
.IgnoreBlank = True
.InputTitle = "Check #"
.ErrorTitle = "Check #"
.InputMessage = "Enter 20 characters or less"
.ErrorMessage = "You can only enter a maximum of 20 characters (uppercase) or less in this column!"
End With