Clear Method

Microsoft Excel Visual Basic

Show All

Clear Method

       

Clear method as it applies to the ChartArea, Legend, and Range objects.

Clears the entire object.

expression.Clear

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

Clear 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.

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