We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

Cell Validation

Is there a way to determine if the validation using a list has just values in it or uses a named range? I noticed that when I type in values for the validation it looks the same as a named range other than a named range only has 1 value. So my question is how do I determine if the user used a named range for validation or just have a list with 1 value (I know that sounds silly, but its possible)? The FirstFormula doesn't really tell me. ListValues is always nothing and ListInFormula is always false too?

3 Replies

LR Lokesh R Syncfusion Team January 26, 2010 07:00 AM UTC

Hi Damon,

Thank you for using Syncfusion products.

Could you please send us a simplified sample, that explains your expectation more precisely and also the version of Essential Studio you have installed.

Regards,
Lokesh


DE Damon Eckert January 27, 2010 06:46 PM UTC

I have posted a direct trac issue and Manimala P is attending to it. But I will see if you answer quicker. :) Here is my attached sample with comments.



CounterExample_3e8a86a6.zip


LR Lokesh R Syncfusion Team January 28, 2010 08:29 AM UTC

Hi Damon,

Thanks for the update.

Yes,it is possible to check whether validation takes the values from NamedRange or ListOfvalues.we have a method called "Workbook.Names.Contains()"in that ,the Workbook.Names property gets or sets the NamedRange Values.I have added the sample codelines below.

Dim Formula as=DV.FirstFormula

IF(Workbook.Names.Contains(Formula))
//Your COde Goes here
EndIF

The method returns true if the FirstFormula contains the Named range value else returns false

please,let us know if this helps.

Regards,
Lokesh

Loader.
Live Chat Icon For mobile
Up arrow icon