Share via


Worksheet.UsedRange Property

Gets a Range object that represents all the cells that have contained a value at any time.

Namespace:  Microsoft.Office.Tools.Excel
Assemblies:   Microsoft.Office.Tools.Excel (in Microsoft.Office.Tools.Excel.dll)
  Microsoft.Office.Tools.Excel.v4.0.Utilities (in Microsoft.Office.Tools.Excel.v4.0.Utilities.dll)

Syntax

'Declaration
ReadOnly Property UsedRange As Range
Range UsedRange { get; }

Property Value

Type: Range
A Range object that represents all the cells that have contained a value at any time.

Remarks

A used range includes any cell that has ever been used. For example, if cell A1 contains a value, and then you delete the value, then cell A1 is considered used. In this case, the UsedRange property will return a range that includes cell A1.

.NET Framework Security

See Also

Reference

Worksheet Interface

Microsoft.Office.Tools.Excel Namespace