Clear contents in cells
How to clear contents in cells using the Excel, VBA and Shortcut methods
1. Select the cells for which you want to clear the contents. 2. Right-click on any of the selected cells. 2. Click Clear Contents. Note: in this example we are removing the contents in range (A2:B5). |
1. Select the cells for which you want to clear the contents. Note: in this example we are removing the contents in range (A2:B5). |
2. Select the Home tab. |
3. Click Clear in the Editing group. 4. Click Clear Contents. |
Worksheets("Analysis").Range("A2:B5").ClearContents
End Sub
Worksheets: The Worksheets object represents all of the worksheets in a workbook, excluding chart sheets.
Range: The Range object is a representation of a single cell or a range of cells in a worksheet.
Cells to clear: This VBA code clears all of the contents in range ("A2:B5"), therefore if you are using the exact VBA code the cells in which you want to clear the contents need to be captured in this range.
Worksheet Name: Have a worksheet named Analysis.
ADJUSTABLE PARAMETERS
Cells to clear: Select the range of cells that you want to clear by changing the range ("A2:B5") in the VBA code to any range in the worksheet that contains the cells in which you want to remove the contents.
Worksheet Selection: Select the worksheet that contains the cells in which you want to remove the contents by changing the Analysis worksheet name, in the VBA code, to any worksheet in the workbook.
NOTES
You need to select the cells in which you want to clear the contents and then action the shortcut.
This tutorial explains and provides step by step instructions on how to clear all contents in cells using the Excel, VBA and Shortcut methods.
Excel Methods: Using Excel you can clear the contents in selected cells with the ribbon option or a cell option.
VBA Methods: Using VBA you can clear the contents in a range that has been specified in the VBA code.
Shortcut Methods: Using a Shortcut you can instantly clear contents in selected cells.