I'm using VBA in Excel 2003 to apply validation to apply validation to a given range of cells from a named list. The user can then select from a dropdown list of values.
Edit: Here's how I'm setting the validation, given a named range called 'MyLookupList'
With validatedRange.Validation
.Delete
.Add Type:=xlValidateList, AlertStyle:=xlValidAlertStop, _
Operator:=xlBetween, Formula1:="=MyLookupList"
.ErrorMessage = "Invalid value. Select one from the dropdown list."
.InCellDropdown = True
End With
All that works fine, but the problem is that when validation is applied from a named list, it is case-insensitive. I.e. if a dropdown choice is "John Smith", then the user can type in "john smith" or "john SmiTh" into the validated cell and Excel will still treat it as a valid entry.
I know that manually creating a list via Tools-->Validation... will make the lookup validation case sensitive, but for my case this is just not feasible - I have to populate the named lists and assign validation programmatically.
Does anyone know of a way to ensure that Excel validation based on named lists is case-sensitive?
Thanks.