Clear Method

Microsoft Excel Visual Basic

Clears the entire object.

expression.Clear

expression    Required. An expression that returns one of the above objects.

ShowClear method as it applies to the CellFormat object.

Clears the criterias set in the FindFormat and ReplaceFormat properties.

expression.Clear

expression    Required. An expression that returns a CellFormat object.

ShowClear method as it applies to the XPath object.

Clears the schema mapping from the cells mapped to the specified XPath.

expression.Clear

expression    Required. An expression that returns a XPath object.

Remarks

This method does not clear the data from the cells mapped to the specified XPath. Use the Clear method of the Range object to clear the data from the cells.

If the specified XPath is mapped in an XML list, then the schema mapping is removed, but the list is not deleted from the worksheet.

Example

This example clears the formulas and formatting in cells A1:G37 on Sheet1.

Worksheets("Sheet1").Range("A1:G37").Clear
		

This example clears the chart area (the chart data and formatting) of Chart1.

Charts("Chart1").ChartArea.Clear