NativeExcel2 for .Net Developer's Reference

IWorksheet.Selection Property

Returns the selected range in the specified worksheet.

[Visual Basic]
PropertyReadOnlySelectionAsIRange
[C#]
IRangeSelection{get;}
[C++]
__propertyIRange*get_Selection();
[JScript]
functiongetSelection():IRange

Property Value

IRange interface.

Example

This example clears the selected range on the sheet one.

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

See Also

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