AddressLocal Method

Applies To

Range Object.

Description

Returns the range reference, as a string in the language of the user.

Syntax

object.AddressLocal(rowAbsolute, columnAbsolute, referenceStyle, external, relativeTo)

object

Required. Returns a reference to this range.

rowAbsolute

Optional. If True or omitted, the row part of the reference is returned as an absolute reference.

columnAbsolute

Optional. If True or omitted, the column part of the reference is returned as an absolute reference.

referenceStyle

Optional. If xlA1 or omitted, the method returns an A1-style reference. If xlR1C1, the method returns an R1C1-style reference.

external

Optional. If True, the method returns an external reference. If False, the method returns a local reference.

relativeTo

Optional. If rowAbsolute and columnAbsolute are False, and referenceStyle is xlR1C1, then you must include a starting point for the relative reference. This argument is a Range object type that defines the starting point.

Remarks

If the reference contains more than one cell, rowAbsolute and columnAbsolute apply to all rows and columns.

See Also

Address Method, Offset Method.

Example

Assume that the following example was created in the American English version of Microsoft Excel and was then run in the German version. The example displays the text shown in the comments.


Set mc = Worksheets(1).Cells(1, 1)
MsgBox mc.AddressLocal()                         ' $A$1
MsgBox mc.AddressLocal(rowAbsolute:=False)       ' $A1
MsgBox mc.AddressLocal(ReferenceStyle:=xlR1C1)   ' Z1S1
MsgBox mc.AddressLocal(ReferenceStyle:=xlR1C1, _
    rowAbsolute:=False, _
    columnAbsolute:=False, _
    relativeTo:=Worksheets(1).Cells(3, 3))       ' Z(-2)S(-2)