I implemented a code that adds Data Validation on cells from a specified range, but the values that contain ,
are chunked 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 this is what I get in the Validation List:
Instead of
US punctuation + alphanumeric lowercase:[a-z0-9,.?;:!&()_'"]+
US punctuation + alphanumeric uppercase:[A-Z0-9,.?;:!&()_'"
US punctuation + alphanumeric mixedcase:[A-Za-z0-9,.?;:!&()_'"
Get the list into a range and reference the range for the data validation. Here's some pseudo code to get you started: