API Reference
Command
Add-OfficeExcelValidationList
Adds a list-based data validation to a worksheet range.
Remarks
Adds a list-based data validation to a worksheet range.
Examples
Add a validation list to a range.
PS>ExcelSheet 'Data' { Add-OfficeExcelValidationList -Range 'C2:C50' -Values 'New','In Progress','Done' }
Restricts column C to the provided values.
Common Parameters
This command supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable.
For more information, see about_CommonParameters.
Syntax
Add-OfficeExcelValidationList [-AllowBlank <Boolean>] [-PassThru] -Range <String> -Values <String[]> [<CommonParameters>]#Parameter set:
ContextParameters
- AllowBlank Boolean
- Allow blank values.
- PassThru SwitchParameter
- Emit the range string after applying validation.
- Range String
- Target range in A1 notation.
- Values String[]
- Allowed values for the dropdown list.
Outputs
System.Object
Add-OfficeExcelValidationList [-AllowBlank <Boolean>] -Document <ExcelDocument> [-PassThru] -Range <String> [-Sheet <String>] [-SheetIndex <Nullable`1>] -Values <String[]> [<CommonParameters>]#Parameter set:
DocumentParameters
- AllowBlank Boolean
- Allow blank values.
- Document ExcelDocument
- Workbook to operate on outside the DSL context.
- PassThru SwitchParameter
- Emit the range string after applying validation.
- Range String
- Target range in A1 notation.
- Sheet String
- Worksheet name when using Document.
- SheetIndex Nullable`1
- Worksheet index (0-based) when using Document.
- Values String[]
- Allowed values for the dropdown list.
Outputs
System.Object