Compare data validation of two cells...URGENT

A

amitkr

hi all,

I need to compare the validation type of two cells.

A function which return true if both the cells have the same validatio
rule or false if the validation rules are diffrent for both the cells .
it's very urgent

Help please
Than
 
B

Bernie Deitrick

amitkr,

You could use a UDF: copy the code below, and paste in a standard module in
the workbook where you want to compare validations.

Function SameVal(R1 As Range, r2 As Range) As Boolean
SameVal = (R1.Validation.Formula1 = r2.Validation.Formula1)
End Function


Use it like

=SameVal(A1,A2)

This will compare the first level of validation.

HTH,
Bernie
MS Excel MVP
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top