Udostępnij za pośrednictwem


NamedRange.EntireColumn Property (2007 System)

Gets a Range that represents the entire column (or columns) that contains the NamedRange control.

Namespace:  Microsoft.Office.Tools.Excel
Assembly:  Microsoft.Office.Tools.Excel.v9.0 (in Microsoft.Office.Tools.Excel.v9.0.dll)

Syntax

'Declaration
<BrowsableAttribute(False)> _
Public ReadOnly Property EntireColumn As Range
'Usage
Dim instance As NamedRange 
Dim value As Range 

value = instance.EntireColumn
[BrowsableAttribute(false)]
public Range EntireColumn { get; }
[BrowsableAttribute(false)]
public:
property Range^ EntireColumn {
    Range^ get ();
}
public function get EntireColumn () : Range

Property Value

Type: Range
A Range that represents the entire column (or columns) that contains the NamedRange control.

Examples

The following code example creates a NamedRange and then sets the border color of the columns and rows that contain the NamedRange to green.

This example is for a document-level customization.

Private entireRowAndColumnRange As Microsoft.Office.Tools.Excel.NamedRange

Private Sub HighlightColumnAndRow()
    entireRowAndColumnRange = Me.Controls.AddNamedRange( _
        Me.Range("C3", "E5"), "entireRowAndColumnRange")

    ' Set the style of the column and row borders to xlSlantDashDot. 
    Me.entireRowAndColumnRange.EntireColumn.Borders.LineStyle = _
        Excel.XlLineStyle.xlSlantDashDot
    Me.entireRowAndColumnRange.EntireRow.Borders.LineStyle = _
        Excel.XlLineStyle.xlSlantDashDot
End Sub
Microsoft.Office.Tools.Excel.NamedRange entireRowAndColumnRange;
private void HighlightColumnAndRow()
{
    entireRowAndColumnRange = this.Controls.AddNamedRange(
        this.Range["C3", "E5"], "entireRowAndColumnRange");

    // Set the style of the column and row borders to xlSlantDashDot. 
    this.entireRowAndColumnRange.EntireColumn.Borders.LineStyle = 
        Excel.XlLineStyle.xlSlantDashDot;
    this.entireRowAndColumnRange.EntireRow.Borders.LineStyle = 
        Excel.XlLineStyle.xlSlantDashDot;
}

.NET Framework Security

See Also

Reference

NamedRange Class

NamedRange Members

Microsoft.Office.Tools.Excel Namespace