# FarPoint.Win.Spread.SheetView.CopyRange

## Content

<div class="doc-site-dotnet-api-container">



<h1 id="FarPoint_Win_Spread_SheetView_CopyRange_" data-uid="FarPoint.Win.Spread.SheetView.CopyRange*">CopyRange Method
</h1>
<div class="markdown level0 summary"></div>
<div class="markdown level0 conceptual"></div>



<a id="FarPoint_Win_Spread_SheetView_CopyRange_" data-uid="FarPoint.Win.Spread.SheetView.CopyRange*"></a>
<h4 id="FarPoint_Win_Spread_SheetView_CopyRange_System_Int32_System_Int32_System_Int32_System_Int32_System_Int32_System_Int32_System_Boolean_" data-uid="FarPoint.Win.Spread.SheetView.CopyRange(System.Int32,System.Int32,System.Int32,System.Int32,System.Int32,System.Int32,System.Boolean)">CopyRange(int, int, int, int, int, int, bool)</h4>
<div class="markdown level1 summary"><p>Copies the data, formatting, formulas, and notes from a block of cells on the sheet to a new location.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">public void CopyRange(int fromRow, int fromColumn, int toRow, int toColumn, int rowCount, int columnCount, bool dataOnly)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Sub CopyRange(fromRow As Integer, fromColumn As Integer, toRow As Integer, toColumn As Integer, rowCount As Integer, columnCount As Integer, dataOnly As Boolean)</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.int32">int</a></td>
      <td><span class="parametername">fromRow</span></td>
      <td><p>Row index of top-left cell in block to copy</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int32">int</a></td>
      <td><span class="parametername">fromColumn</span></td>
      <td><p>Column index of top-left cell in block to copy</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int32">int</a></td>
      <td><span class="parametername">toRow</span></td>
      <td><p>Row index of top-left cell in destination</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int32">int</a></td>
      <td><span class="parametername">toColumn</span></td>
      <td><p>Column index of top-left cell in destination</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int32">int</a></td>
      <td><span class="parametername">rowCount</span></td>
      <td><p>Number of rows in the block</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int32">int</a></td>
      <td><span class="parametername">columnCount</span></td>
      <td><p>Number of columns in the block</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.boolean">bool</a></td>
      <td><span class="parametername">dataOnly</span></td>
      <td><p>Whether only the data is copied, or the data and formatting</p>
</td>
    </tr>
  </tbody>
</table>
<h5 class="exceptions">Exceptions</h5>
<table class="table table-bordered table-condensed">
  <thead>
    <tr>
      <th>Type</th>
      <th>Condition</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.invalidoperationexception">InvalidOperationException</a></td>
      <td><p>Operation is not valid; cannot copy entire sheet of cells</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.invalidoperationexception">InvalidOperationException</a></td>
      <td><p>Operation is not valid; cannot copy entire columns over partial columns</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.invalidoperationexception">InvalidOperationException</a></td>
      <td><p>Operation is not valid; cannot copy entire rows over partial rows</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.invalidoperationexception">InvalidOperationException</a></td>
      <td><p>Operation is not valid; cannot copy a range of cells over part of a spanned cell</p>
</td>
    </tr>
  </tbody>
</table>
</div>
