Create Names Method

This method creates range names based on text labels in specified cells. The syntax is:

RangeObject.CreateNames(Top, Left, Bottom, Right)

The parameters are optional and have the default value of False. If one of the parameters is set to True, then the corresponding row (Top or Bottom) or column (Left or Right) is used to supply the names for the named ranges. If all of the parameters are False, then Excel tries to guess the location of the names. (I would generally advise against letting an application guess at anything.)

To illustrate, the following code, when applied to the sheet in Figure 19-8, will define three named ranges:

Range("A1:C3").CreateNames Top:=True For instance, the range A2:A3 will be named John.

0 0

Post a comment