Partager via


Range.ApplyNames Method

Applies names to the cells in the specified range.

Namespace:  Microsoft.Office.Interop.Excel
Assembly:  Microsoft.Office.Interop.Excel (in Microsoft.Office.Interop.Excel.dll)

Syntax

'Declaration
Function ApplyNames ( _
    Names As Object, _
    IgnoreRelativeAbsolute As Object, _
    UseRowColumnNames As Object, _
    OmitColumn As Object, _
    OmitRow As Object, _
    Order As XlApplyNamesOrder, _
    AppendLast As Object _
) As Object
'Usage
Dim instance As Range
Dim Names As Object
Dim IgnoreRelativeAbsolute As Object
Dim UseRowColumnNames As Object
Dim OmitColumn As Object
Dim OmitRow As Object
Dim Order As XlApplyNamesOrder
Dim AppendLast As Object
Dim returnValue As Object

returnValue = instance.ApplyNames(Names, _
    IgnoreRelativeAbsolute, UseRowColumnNames, _
    OmitColumn, OmitRow, Order, AppendLast)
Object ApplyNames(
    Object Names,
    Object IgnoreRelativeAbsolute,
    Object UseRowColumnNames,
    Object OmitColumn,
    Object OmitRow,
    XlApplyNamesOrder Order,
    Object AppendLast
)

Parameters

  • Names
    Type: System.Object

    Optional Object. An array of the names to be applied. If this argument is omitted, all names on the sheet are applied to the range.

  • IgnoreRelativeAbsolute
    Type: System.Object

    Optional Object. True to replace references with names, regardless of the reference types of either the names or references; False to replace absolute references only with absolute names, relative references only with relative names, and mixed references only with mixed names. The default value is True.

  • UseRowColumnNames
    Type: System.Object

    Optional Object. True to use the names of row and column ranges that contain the specified range if names for the range cannot be found; False to ignore the OmitColumn and OmitRow arguments. The default value is True.

  • OmitColumn
    Type: System.Object

    Optional Object. True to replace the entire reference with the row-oriented name. The column-oriented name can be omitted only if the referenced cell is in the same column as the formula and is within a row-oriented named range. The default value is True.

  • OmitRow
    Type: System.Object

    Optional Object. True to replace the entire reference with the column-oriented name. The row-oriented name can be omitted only if the referenced cell is in the same row as the formula and is within a column-oriented named range. The default value is True.

  • AppendLast
    Type: System.Object

    Optional Object. True to replace the definitions of the names in Names and also replace the definitions of the last names that were defined; False to replace the definitions of the names in Names only. The default value is False.

Return Value

Type: System.Object

Remarks

You can use the Array function to create the list of names for the Names argument.

If you want to apply names to the entire sheet, use Cells.ApplyNames.

You cannot "unapply" names; to delete names, use the Delete method.

See Also

Reference

Range Interface

Range Members

Microsoft.Office.Interop.Excel Namespace