Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
Clears the cell values of the cells in the range, with special consideration given to cell controls.
Remarks
If the range contains only blanks and cells with cell controls set to their defaults (e.g. checkboxes with a cell value of FALSE), then the values and cell control formatting are removed. Otherwise, the cells with cell controls are set to their defaults (e.g. checkboxes are set to cell value of FALSE), and all other cells have their values cleared.
Syntax
expression.ResetControls
-or-
expression.RemoveControls
expression A variable that represents a Range object.
Parameters
Optionally, you can use method RemoveControls to clear the cell values of the cells in the range. If ommitted, it gets set to False. When set to True, it clears all cell control formatting from the range selection, in addition to clearing the cell values.
Examples
This example removes contents from the range A1:C4 on Sheet1.
Range("A1:C4").ResetContents
Selection.ResetContents
This example clears the values from the cells in the range A1:C4 on Sheet1.
Range("A1:C4").ClearContents
Selection.ClearContents
Selection.ClearContents RemoveControls := True
Selection.ClearContents RemoveControls := False
This example clears all cell control formatting from the given range, leaving cell values in place.
Range("A1:C4").RemoveControls
Selection.RemoveControls
Support and feedback
Have questions or feedback about Office VBA or this documentation? Please see Office VBA support and feedback for guidance about the ways you can receive support and provide feedback.