# 💾 sheet.rangeByRect()

[GAS](../../..) ⟩ [app](../..) ⟩ [prototypes](..) ⟩ [sheet.prototype]() ⟩ .rangeByRect()

{% tabs %}
{% tab title="💾 程式" %}
* ⬆️ 需要： [rangerect](../../../custom-objects/rangerect "mention")

```javascript
  // 🔸 sheet.rangeByRect(rect: RangeRect)
  // require: RangeRect
  rangeByRect(rect){
    const range = this.getRange(...rect.toArray());
    range.__proto__ = app.range.prototype;           // ⭐️ extend range
    return range;
  },
```
{% endtab %}

{% tab title="⬇️ 應用" %}
* [class-average](../../../projects/class-average "mention")
{% endtab %}

{% tab title="👥 相關" %}
* 簡化選取 [range](../../../classes/range "mention")
{% endtab %}
{% endtabs %}
