excel - Select cells conditionally and use as data validation list -


I type a to sheet 2 which is not empty, and Use this as a list for data validation on a range of Sheet1 I already have the code to add to the verification:

  cell.VersionCell ( XLCL typeFormula). Offset (0, 1). Choose with selection. Validation Delete. Add type: = xlValidateList, AlertStyle: = XlValidAlertStop, Operator: = _xlBetween, Formula 1: = "= ** Border is required **". IgnoreBlank = True .CellDropdown = True End With  

I can not work in Excel 2003 ; It is not possible to add a reference to another sheet for data validation in Excel 2003.

If you want your verification list crosses the worksheets, you can enter the named range for verification data Need to define. In Excel 2003 (if I remember correctly) you set name categories in Insert> Named categories> Define if you want to assign Validation to the code, then you can use only the name of your category as address.

  room. Specialcale (xlCellTypeFormulas). Offset (0, 1). Select with selection. Remove validity. Add type: = xlValidateList, AlertStyle: = xlValidAlertStop, Operator: = _xlBetween, Formula1: = "= TheNameOfYourRange". Skipping Blank = True .CilgradeDown = With True End  

Of course you It may not be in the code - you only need to define the verification rule once, then update the named category from that point. To update the designated category to refer to non-empty cells on a specific worksheet, you can use something like this.


Comments