Cmdlet
Set-OfficeExcelNamedRange
Creates or updates a named range.
Syntax
Set-OfficeExcelNamedRange
[-Global]
[-Hidden]
[-Name] <String>
[-PassThru]
[-Range] <String>
[-Save]
[-ValidationMode <Sanitize| Strict>]
[<CommonParameters>]#Parameter set:
ContextSet-OfficeExcelNamedRange
-Document <ExcelDocument>
[-Hidden]
[-Name] <String>
[-PassThru]
[-Range] <String>
[-Save]
[-Sheet <String>]
[-SheetIndex <Int32>]
[-ValidationMode <Sanitize| Strict>]
[<CommonParameters>]#Parameter set:
DocumentDescription
Defaults to the current sheet scope when used inside the Excel DSL.
Examples
Define a named range inside a sheet.
ExcelSheet 'Data' { Set-OfficeExcelNamedRange -Name 'Totals' -Range 'B2:B50' }Creates a sheet-scoped name for the range.
Parameters
- -Global SwitchParameter
- Force a workbook-global name even inside a sheet block.
- Mark the defined name as hidden.
- -Name String
- Name of the defined range.
- -PassThru SwitchParameter
- Emit the name after creation.
- -Range String
- Range in A1 notation.
- -Save SwitchParameter
- Save the workbook immediately after setting the name.
- -ValidationMode ExcelDefinedNameValidationMode
- Validate or sanitize the defined name.
- Possible values:
Sanitize,Strict - -Document ExcelDocument
- Workbook to operate on outside the DSL context.
- -Sheet String
- Worksheet name when using Document.
- -SheetIndex Int32
- Worksheet index (0-based) when using Document.
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.