I have implemented code that adds data validation to cells from a specified range, but values containing, are broken into pieces ...
This is my code.
var listFormats = new List<string>(); listFormats.Add("US punctuation + alphanumeric lowercase:[a-z0-9,.?;:!&()_'" + '"' + "]+"); listFormats.Add("US punctuation + alphanumeric uppercase:[A-Z0-9,.?;:!&()_'" + '"' + "]+"); listFormats.Add("US punctuation + alphanumeric mixedcase:[A-Za-z0-9,.?;:!&()_'" + '"' + "]+"); var flatListFormats = string.Join(",", listFormats.ToArray()); rng.Validation.Add(XlDVType.xlValidateList, XlDVAlertStyle.xlValidAlertInformation, XlFormatConditionOperator.xlBetween, flatListDelimiters, Type.Missing);
And here is what I get in the validation list:

Instead
US punctuation + alphanumeric lowercase:[a-z0-9,.?;:!&()_'"]+ US punctuation + alphanumeric uppercase:[A-Z0-9,.?;:!&()_'" US punctuation + alphanumeric mixedcase:[A-Za-z0-9,.?;:!&()_'"
Valip source share