# GrapeCity.Spreadsheet.IValidation.Modify

## Content

<div class="doc-site-dotnet-api-container">



<h1 id="GrapeCity_Spreadsheet_IValidation_Modify_" data-uid="GrapeCity.Spreadsheet.IValidation.Modify*">Modify Method
</h1>
<div class="markdown level0 summary"></div>
<div class="markdown level0 conceptual"></div>



<a id="GrapeCity_Spreadsheet_IValidation_Modify_" data-uid="GrapeCity.Spreadsheet.IValidation.Modify*"></a>
<h4 id="GrapeCity_Spreadsheet_IValidation_Modify_GrapeCity_Spreadsheet_DataValidationType_GrapeCity_Spreadsheet_DataValidationErrorStyle_GrapeCity_Spreadsheet_DataValidationOperator_System_String_System_String_" data-uid="GrapeCity.Spreadsheet.IValidation.Modify(GrapeCity.Spreadsheet.DataValidationType,GrapeCity.Spreadsheet.DataValidationErrorStyle,GrapeCity.Spreadsheet.DataValidationOperator,System.String,System.String)">Modify(DataValidationType, DataValidationErrorStyle, DataValidationOperator, string, string)</h4>
<div class="markdown level1 summary"><p>Modifies existing data validation for a range of cells using the specified options.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">IValidation Modify(DataValidationType type, DataValidationErrorStyle errorStyle = DataValidationErrorStyle.Stop, DataValidationOperator @operator = DataValidationOperator.Between, string formula1 = null, string formula2 = null)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Function Modify(type As DataValidationType, Optional errorStyle As DataValidationErrorStyle = DataValidationErrorStyle.Stop, Optional [operator] As DataValidationOperator = DataValidationOperator.Between, Optional formula1 As String = Nothing, Optional formula2 As String = Nothing) As IValidation</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.DataValidationType.html">DataValidationType</a></td>
      <td><span class="parametername">type</span></td>
      <td><p>A <a class="xref" href="GrapeCity.Spreadsheet.DataValidationType.html">DataValidationType</a> value indicates the type of data validation to add.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="GrapeCity.Spreadsheet.DataValidationErrorStyle.html">DataValidationErrorStyle</a></td>
      <td><span class="parametername">errorStyle</span></td>
      <td><p>A <a class="xref" href="GrapeCity.Spreadsheet.DataValidationErrorStyle.html">DataValidationErrorStyle</a> value indicates the error style to use for error messages.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="GrapeCity.Spreadsheet.DataValidationOperator.html">DataValidationOperator</a></td>
      <td><span class="parametername">operator</span></td>
      <td><p>A <a class="xref" href="GrapeCity.Spreadsheet.DataValidationOperator.html">DataValidationOperator</a> value indicates the data validation operator.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.string">string</a></td>
      <td><span class="parametername">formula1</span></td>
      <td><p>A string value indicates the first data validation value, formula or list.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.string">string</a></td>
      <td><span class="parametername">formula2</span></td>
      <td><p>A string value indicates the second data validation value for <a class="xref" href="GrapeCity.Spreadsheet.DataValidationOperator.html#GrapeCity_Spreadsheet_DataValidationOperator_Between">Between</a> or <a class="xref" href="GrapeCity.Spreadsheet.DataValidationOperator.html#GrapeCity_Spreadsheet_DataValidationOperator_NotBetween">NotBetween</a>.</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="GrapeCity.Spreadsheet.IValidation.html">IValidation</a></td>
      <td><p>The modified data validation. <code>null</code> if the data validation cannot be modified.</p>
</td>
    </tr>
  </tbody>
</table>
<h5 id="GrapeCity_Spreadsheet_IValidation_Modify_GrapeCity_Spreadsheet_DataValidationType_GrapeCity_Spreadsheet_DataValidationErrorStyle_GrapeCity_Spreadsheet_DataValidationOperator_System_String_System_String__remarks">Remarks</h5>
<div class="markdown level1 remarks"><p>Because <code class="paramref">formula1</code> and <code class="paramref">formula2</code> properties are also used for primitive value, the formula must start with &quot;=&quot;.</p>
</div>
</div>
