다음을 통해 공유


Range.CreateNames Method (Excel)

Creates names in the specified range, based on text labels in the sheet.

Syntax

.CreateNames(Top, Left, Bottom, Right)

A variable that represents a Range object.

Parameters

Name

Required/Optional

Data Type

Description

Top

선택

Variant

True to create names by using labels in the top row. The default value is False.

Left

선택

Variant

True to create names by using labels in the left column. The default value is False.

Bottom

선택

Variant

True to create names by using labels in the bottom row. The default value is False.

Right

선택

Variant

True to create names by using labels in the right column. The default value is False.

Return Value

Variant

Remarks

If you don’t specify one of Top, Left, Bottom, or Right, Microsoft Excel guesses the location of the text labels, based on the shape of the specified range.

Example

This example creates names for cells B1:B3 based on the text in cells A1:A3. Note that you must include the cells that contain the names in the range, even though the names are created only for cells B1:B3.

Set rangeToName = Worksheets("Sheet1").Range("A1:B3") 
rangeToName.CreateNames Left:=True

참고 항목

개념

Range Object

Range Object Members