Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
Gets the number of the first column in the first area of 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
Public ReadOnly Property Column As Integer
'Usage
Dim instance As NamedRange
Dim value As Integer
value = instance.Column
public int Column { get; }
public:
property int Column {
int get ();
}
public function get Column () : int
Property Value
Type: System.Int32
The number of the first column in the first area of the NamedRange control. Column A returns 1, column B returns 2, and so on.
Examples
The following code example creates a NamedRange and uses the Column and Row properties to display the numbers of the first column and row in the NamedRange.
This example is for a document-level customization.
Private columnAndRowRange As Microsoft.Office.Tools.Excel.NamedRange
Private Sub DisplayColumnAndRow()
columnAndRowRange = Me.Controls.AddNamedRange( _
Me.Range("A3", "D6"), "columnAndRowRange")
MessageBox.Show("The first column in the range is column " & _
Me.columnAndRowRange.Column.ToString() & _
" and the first row is " & _
Me.columnAndRowRange.Row.ToString())
End Sub
Microsoft.Office.Tools.Excel.NamedRange columnAndRowRange;
private void DisplayColumnAndRow()
{
columnAndRowRange = this.Controls.AddNamedRange(
this.Range["A3", "D6"], "columnAndRowRange");
MessageBox.Show("The first column in the range is column " +
this.columnAndRowRange.Column.ToString() +
" and the first row is " +
this.columnAndRowRange.Row.ToString());
}
.NET Framework Security
- Full trust for the immediate caller. This member cannot be used by partially trusted code. For more information, see Using Libraries from Partially Trusted Code.