Address Property

Microsoft Office Web Components Object Model

Show All

Address Property

       

Address property as it applies to the Hyperlink and PivotHyperlink objects.

 Returns or sets a String that represents the address of the target document. Read/write.

expression.Address

expression   Required. An expression that returns a Hyperlink or PivotHyperlink object.

 

Address property as it applies to the Range object.

Returns a String that represents the address of the specified range (for example, A1). Read-only.

expression.Address(RowAbsolute, ColumnAbsolute, ReferenceStyle, External, RelativeTo)

expression   Required. An expression that returns a Range object.

RowAbsolute   Optional Variant. True to return the row part of the reference as an absolute reference. The default value is True.

ColumnAbsolute   Optional Variant. True to return the column part of the reference as an absolute reference. The default value is True.

ReferenceStyle   Optional xlReferenceStyle. The reference style.

ReferenceStyle can be one of the following XlReferenceStyle constants.
xlA1
xlR1C1

External   Optional Variant. True to return an external reference. An external reference includes the name of the worksheet. False to return a local reference. The default value is False.

RelativeTo   Optional Variant. If RowAbsolute and ColumnAbsolute are False, and ReferenceStyle is xlR1C1, you must include a starting point for the relative reference. This argument is a Range object that defines the starting point.

 

Example

As it applies to the Hyperlink object.

The following example inserts a hyperlink into cell C10 of Sheet1 in Spreadsheet1.

Sub Insert_Hyperlink()
    Dim rngNewHyperlink

    Set rngNewHyperlink = Spreadsheet1.Worksheets("sheet1").Range("c10")

    rngNewHyperlink.Value = "Click to read about the latest Office updates"
    rngNewHyperlink.Hyperlink.Address = "http://officeupdate.microsoft.com"
End Sub

As it applies to the Range object.

This example returns the address of the visible range.

MsgBox Spreadsheet1.ActiveSheet.VisibleRange.Address