Hi Elsa,
Sorry for the delay in getting back to you. Using the following code
workbook.Allow3DRangesInDataValidation = true;
which will allow datavalidation having the datarange referring to the ranges in other sheets.
Please take a look at the attached sample which will add the hidden sheet containing some datavalidation values and primary keys in the along side column which is referred by the data range for datavalidation used in another sheet.
Sample :
Allow3DRanges
BestRegards,
Bharath.
>I added a "hidden" worksheet that contains the validation values. Alongside (in an adjacent column), I stored the "primary keys." Then, I used the DataRange property to point to the range in this other worksheet. You need to make sure that workbook.Allow3DRangesInDataValidation = true; for this strategy to work.