NativeExcel2 for .Net Developer's Reference

IRange.ClearMethod

Clears the cells in the specified range.

[Visual Basic]
SubClear()
[C#]
voidClear();
[C++]
voidClear();
[JScript]
functionClear();

Example

This example clears data and formatting in cells A1:G37 on sheet one.

[C#]
 book.Worksheets[1].Range["A1:G37"].Clear(); 
[VisualBasic]
 book.Worksheets(1).Range("A1:G37").Clear()
[C++]
 book->Worksheets->Item[1]->Range->Item[S"A1:G37"]->Clear(); 

See Also

IRange Interface | NativeExcel Namespace | ClearContents Method