Share via


XmlMappedRange.CurrentRegion Property

Gets a Range that represents the current region.

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

Syntax

'Declaration
ReadOnly Property CurrentRegion As Range
    Get
Range CurrentRegion { get; }

Property Value

Type: Microsoft.Office.Interop.Excel.Range
A Range that represents the current region.

Remarks

The current region is a range bounded by any combination of blank rows and blank columns.

This property cannot be used on a protected worksheet.

Examples

The following code example uses the CurrentRegion property to set the color of the interior region of an XmlMappedRange to green. This code example assumes that the current worksheet contains an XmlMappedRange named CustomerLastNameCell.

Private Sub ColorCurrentRegion()
    ' Set the color of the region to the RGB value for green.
    Me.CustomerLastNameCell.CurrentRegion.Interior.Color = &HFF00
End Sub
private void ColorCurrentRegion()
{
    // Set the color of the region to the RGB value for green.
    this.CustomerLastNameCell.CurrentRegion.Interior.Color = 0xFF00;
}

.NET Framework Security

See Also

Reference

XmlMappedRange Interface

Microsoft.Office.Tools.Excel Namespace