# GrapeCity.Documents.Excel.IRange.Replace

## Content

<div class="doc-site-dotnet-api-container">



<h1 id="GrapeCity_Documents_Excel_IRange_Replace_" data-uid="GrapeCity.Documents.Excel.IRange.Replace*">Replace Method
</h1>
<div class="markdown level0 summary"></div>
<div class="markdown level0 conceptual"></div>



<a id="GrapeCity_Documents_Excel_IRange_Replace_" data-uid="GrapeCity.Documents.Excel.IRange.Replace*"></a>
<h4 id="GrapeCity_Documents_Excel_IRange_Replace_System_Object_System_Object_GrapeCity_Documents_Excel_ReplaceOptions_" data-uid="GrapeCity.Documents.Excel.IRange.Replace(System.Object,System.Object,GrapeCity.Documents.Excel.ReplaceOptions)">Replace(object, object, ReplaceOptions)</h4>
<div class="markdown level1 summary"><p>Search in formulas and replace.
Using this method doesn't change either the selection or the active cell.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">int Replace(object what, object replacement, ReplaceOptions options = null)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Function Replace(what As Object, replacement As Object, Optional options As ReplaceOptions = Nothing) As Integer</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.object">object</a></td>
      <td><span class="parametername">what</span></td>
      <td><p>The string you want to search for.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.object">object</a></td>
      <td><span class="parametername">replacement</span></td>
      <td><p>The replacement string.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="GrapeCity.Documents.Excel.ReplaceOptions.html">ReplaceOptions</a></td>
      <td><span class="parametername">options</span></td>
      <td><p>The replace options.</p>
</td>
    </tr>
  </tbody>
</table>
<h5 class="returns">Returns</h5>
<table class="table table-bordered table-condensed">
  <thead>
    <tr>
      <th>Type</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><p>Number of cells that was replaced.</p>
</td>
    </tr>
  </tbody>
</table>
</div>
