# GrapeCity.Spreadsheet.ISort.SetRange

## Content

<div class="doc-site-dotnet-api-container">



<h1 id="GrapeCity_Spreadsheet_ISort_SetRange_" data-uid="GrapeCity.Spreadsheet.ISort.SetRange*">SetRange Method
</h1>
<div class="markdown level0 summary"></div>
<div class="markdown level0 conceptual"></div>



<a id="GrapeCity_Spreadsheet_ISort_SetRange_" data-uid="GrapeCity.Spreadsheet.ISort.SetRange*"></a>
<h4 id="GrapeCity_Spreadsheet_ISort_SetRange_GrapeCity_Spreadsheet_Reference_" data-uid="GrapeCity.Spreadsheet.ISort.SetRange(GrapeCity.Spreadsheet.Reference)">SetRange(Reference)</h4>
<div class="markdown level1 summary"><p>Sets the range over which the sort occurs.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">void SetRange(Reference rng)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Sub SetRange(rng As Reference)</code></pre>
</div>
<h5 class="parameters">Parameters</h5>
<table class="table table-bordered table-condensed">
  <thead>
    <tr>
      <th>Type</th>
      <th>Name</th>
      <th>Description</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td><a class="xref" href="GrapeCity.Spreadsheet.Reference.html">Reference</a></td>
      <td><span class="parametername">rng</span></td>
      <td><p>Specifies the range over which the sort represented by the <a class="xref" href="GrapeCity.Spreadsheet.ISort.html">ISort</a> object occurs.</p>
</td>
    </tr>
  </tbody>
</table>
<h5 id="GrapeCity_Spreadsheet_ISort_SetRange_GrapeCity_Spreadsheet_Reference__remarks">Remarks</h5>
<div class="markdown level1 remarks"><p><a class="xref" href="GrapeCity.Spreadsheet.ISort.SetRange.html#GrapeCity_Spreadsheet_ISort_SetRange_GrapeCity_Spreadsheet_Reference_">SetRange(Reference)</a> can only be used when applying a sort to a sheet range, and cannot be used if the range is within a table.</p>
</div>


<a id="GrapeCity_Spreadsheet_ISort_SetRange_" data-uid="GrapeCity.Spreadsheet.ISort.SetRange*"></a>
<h4 id="GrapeCity_Spreadsheet_ISort_SetRange_System_String_" data-uid="GrapeCity.Spreadsheet.ISort.SetRange(System.String)">SetRange(string)</h4>
<div class="markdown level1 summary"><p>Sets the range over which the sort occurs.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">void SetRange(string rng)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Sub SetRange(rng As String)</code></pre>
</div>
<h5 class="parameters">Parameters</h5>
<table class="table table-bordered table-condensed">
  <thead>
    <tr>
      <th>Type</th>
      <th>Name</th>
      <th>Description</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.string">string</a></td>
      <td><span class="parametername">rng</span></td>
      <td><p>Specifies the range over which the sort represented by the <a class="xref" href="GrapeCity.Spreadsheet.ISort.html">ISort</a> object occurs.</p>
</td>
    </tr>
  </tbody>
</table>
<h5 id="GrapeCity_Spreadsheet_ISort_SetRange_System_String__remarks">Remarks</h5>
<div class="markdown level1 remarks"><p><a class="xref" href="GrapeCity.Spreadsheet.ISort.SetRange.html#GrapeCity_Spreadsheet_ISort_SetRange_GrapeCity_Spreadsheet_Reference_">SetRange(Reference)</a> can only be used when applying a sort to a sheet range, and cannot be used if the range is within a table.</p>
</div>


<a id="GrapeCity_Spreadsheet_ISort_SetRange_" data-uid="GrapeCity.Spreadsheet.ISort.SetRange*"></a>
<h4 id="GrapeCity_Spreadsheet_ISort_SetRange_GrapeCity_Spreadsheet_IRange_" data-uid="GrapeCity.Spreadsheet.ISort.SetRange(GrapeCity.Spreadsheet.IRange)">SetRange(IRange)</h4>
<div class="markdown level1 summary"><p>Sets the range over which the sort occurs.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">void SetRange(IRange rng)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Sub SetRange(rng As IRange)</code></pre>
</div>
<h5 class="parameters">Parameters</h5>
<table class="table table-bordered table-condensed">
  <thead>
    <tr>
      <th>Type</th>
      <th>Name</th>
      <th>Description</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td><a class="xref" href="GrapeCity.Spreadsheet.IRange.html">IRange</a></td>
      <td><span class="parametername">rng</span></td>
      <td><p>Specifies the range over which the sort represented by the <a class="xref" href="GrapeCity.Spreadsheet.ISort.html">ISort</a> object occurs.</p>
</td>
    </tr>
  </tbody>
</table>
<h5 id="GrapeCity_Spreadsheet_ISort_SetRange_GrapeCity_Spreadsheet_IRange__remarks">Remarks</h5>
<div class="markdown level1 remarks"><p><a class="xref" href="GrapeCity.Spreadsheet.ISort.SetRange.html#GrapeCity_Spreadsheet_ISort_SetRange_GrapeCity_Spreadsheet_Reference_">SetRange(Reference)</a> can only be used when applying a sort to a sheet range, and cannot be used if the range is within a table.</p>
</div>
</div>
