XlsRange Clear Method |
Name | Description | |
---|---|---|
![]() |
Clear(Boolean) |
Clears the cells in the specified range and optionally resets the cell style to "Normal".
|
![]() ![]() |
Clear(ExcelClearOptions) |
Clears the cell based on clear options.
![]()
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>
|