Skip to main content

Worksheet.UsedRange property

Table of contents
  1. Syntax
  2. Example

Returns a Range object that represents the used range on the specified worksheet. Read-only.

Syntax

expression.UsedRange

expression A variable that represents a Worksheet object.

Example

This example selects the used range on Sheet1.

Worksheets("Sheet1").Activate 
ActiveSheet.UsedRange.Select

When this code is used with the following example table, range A1:F7 will be selected.

Leave a comment

Your email address will not be published. Required fields are marked *

Format your code: <pre><code class="language-vba">place your code here</code></pre>