How Do we add data-validation to an entire column in exceljs ? Or Is there any other library that supports such a feature ?
Asked
Active
Viewed 4,199 times
1 Answers
5
You can reach that by providing fixed number of cells in the target column, assuming the target column is column L, then you can use the following snippet:
sheet.dataValidations.add('L2:L9999', {
type: 'list',
allowBlank: false,
formulae: ['"male,female,other"'],
showErrorMessage: true,
errorStyle: 'error',
error: 'The value Valid',
});
For more info, see the following: how to set validation on a column #1109 & Data validation to the whole column? #614

Ahmed Farag
- 83
- 1
- 7