NativeExcel2 for .Net Developer's Reference

IWorksheet.UsedRange Property

Returns an IRange interface that represents the used range on the specified worksheet.

[Visual Basic]
PropertyReadOnlyUsedRangeAsIRange
[C#]
IRangeUsedRange{get;}
[C++]
__propertyIRange*get_UsedRange();
[JScript]
functiongetUsedRange():IRange

Property Value

IRange interface.

Example

This example sets the font style in used cells on the first sheet to italic.

[C#]
book.Worksheets[1].UsedRange.Font.Italic = true; 
[VisualBasic]
book.Worksheets(1).UsedRange.Font.Italic = True
[C++]
book->Worksheets->Item[1]->UsedRange->Font->Italic = true;

See Also

IWorksheet Interface | NativeExcel Namespace | IRange Interface