Click or drag to resize

XlsRange Clear Method

Overload List
Name Description
Protected method Clear(Boolean)
Clears the cells in the specified range and optionally resets the cell style to "Normal".
Public method Code example Clear(ExcelClearOptions)
Clears the cell based on clear options.
Examples
The following code illustrates how to clear the Range with clear options:
<para>//Create worksheet</para><para>Workbook workbook = new Workbook();</para><para>workbook.LoadFromFile("Sample.xlsx");</para><para>Worksheet worksheet = workbook.Worksheets[0];</para><para>//Clears the Range C2 with its clear options</para><para>worksheet.Range["C2"].Clear(ExcelClearOptions.ClearAll);</para><para>//Save to file</para><para>workbook.SaveToFile("ClearContents.xlsx");</para>
Top
See Also