NativeExcel for .Net Developer's Reference

IWorksheet.Selection Property

Returns the selected range in the specified worksheet.

[Visual Basic]
Property ReadOnly Selection As IRange
[C#]
IRange Selection { get; }
[C++]
__property IRange* get_Selection();
[JScript]
function get Selection() : IRange

Property Value

IRange interface.

Example

This example clears the selected range on the sheet one.

[C#]
book.Worksheets[1].Selection.Clear();
[Visual Basic]
book.Worksheets(1).Selection.Clear()
[C++]
book->Worksheets->Item[1]->Selection->Clear();

See Also

IWorksheet Interface | NativeExcel Namespace | IRange Interface | IRange>Select