
- MS Excel Basics
- Excel - Home
- Excel - Getting Started
- Excel - Explore Window
- Excel - Backstage
- Excel - Entering Values
- Excel - Move Around
- Excel - Save Workbook
- Excel - Create Worksheet
- Excel - Copy Worksheet
- Excel - Hiding Worksheet
- Excel - Delete Worksheet
- Excel - Close Workbook
- Excel - Open Workbook
- Excel - Context Help
- Editing Worksheet
- Excel - Insert Data
- Excel - Select Data
- Excel - Delete Data
- Excel - Move Data
- Excel - Rows & Columns
- Excel - Copy & Paste
- Excel - Find & Replace
- Excel - Spell Check
- Excel - Zoom In-Out
- Excel - Special Symbols
- Excel - Insert Comments
- Excel - Add Text Box
- Excel - Undo Changes
- Formatting Cells
- Excel - Setting Cell Type
- Excel - Setting Fonts
- Excel - Text Decoration
- Excel - Rotate Cells
- Excel - Setting Colors
- Excel - Text Alignments
- Excel - Merge & Wrap
- Excel - Borders and Shades
- Excel - Apply Formatting
- Formatting Worksheets
- Excel - Sheet Options
- Excel - Adjust Margins
- Excel - Page Orientation
- Excel - Header and Footer
- Excel - Insert Page Breaks
- Excel - Set Background
- Excel - Freeze Panes
- Excel - Conditional Format
- Working with Formula
- Excel - Creating Formulas
- Excel - Copying Formulas
- Excel - Formula Reference
- Excel - Using Functions
- Excel - Builtin Functions
- Advanced Operations
- Excel - Data Filtering
- Excel - Data Sorting
- Excel - Using Ranges
- Excel - Data Validation
- Excel - Using Styles
- Excel - Using Themes
- Excel - Using Templates
- Excel - Using Macros
- Excel - Adding Graphics
- Excel - Cross Referencing
- Excel - Printing Worksheets
- Excel - Email Workbooks
- Excel- Translate Worksheet
- Excel - Workbook Security
- Excel - Data Tables
- Excel - Pivot Tables
- Excel - Simple Charts
- Excel - Pivot Charts
- Excel - Keyboard Shortcuts
- MS Excel Resources
- Excel - Quick Guide
- Excel - Useful Resources
- Excel - Discussion
How To Clear The Entire Sheet Or Specified Range In Excel?
Do you often encounter too much data and spend a lot of time selecting and clearing Excel sheets?
If so, this tutorial will be helpful to you.
When analysing elaborative Excel worksheets, removing non-relevant information often makes it easier to study them. This tutorial explains how to clear an entire spreadsheet and a specified range in MS Excel using two simple methods
Method 1: How to Clear The Entire Sheet?
This is an easy procedure. If you want to clear the entire sheet, you can use a keyboard shortcut or from the corner cell. We learn how to do it in a few steps.
Step 1 − Select the top left corner cell between the rows and the column headers.
Step 2 − Right-click and choose "Delete" from the drop-down menu.
Following this, the spreadsheet would be clean of all data.
You can also use an alternative approach. Using the keyboard shortcut, press Control + A to select all cells in the spreadsheet. Then right-click and repeat step 2, and the result will be the same as above.
Method 2: How To Clear a Specified Range?
Suppose you want to clear only a particular set of cells in the spreadsheet. Doing so one by one could be cumbersome. However, using the Visual Basic for Applications (VBA), you can remove one or more specified ranges of cells from your spreadsheet.
The VBA is a computer programming language developed by Microsoft. It automates repetitive and routine tasks, simplifying the process of working out complex data sets. Let's understand how this works using the same data set mentioned earlier.
Step 1 − Press the Alt + F11 keys to open the Microsoft Excel Visual Basic Editor dialogue box.
Step 2 − Right-click on "Microsoft Excel Objects", and from the drop-down menu, select Insert → Module.
Step 3 − Paste the mentioned VBA code in the top right box after inserting the module to clear only a specified range of cells. Let's say we want to remove only the table with the range C8 to F12 highlighted in green. We modify the range in the code.
VBA Code to clear specific range of cells from Excel sheet −
Sub sbClearCells() Range("C8:F12").Clear End Sub
Step 4 − Press F5 on your keyboard or click the "Run Program" button to execute the code.
The resulting table will look like this.
Step 5 − If you want to remove multiple ranges of cells from your spreadsheet, you can modify the VBA code mentioned above and do it in one easy step.
Suppose you want to remove cells A3 to B5; cells D13 to F15; and cells B10 to C11. Enter the code in the Module window and repeat step 3.
Sub sbClearCells() Range("A3:B5").Clear Range("D13:F15").Clear Range("B10:C11").Clear End Sub
The VBA program will clear the selected ranges from the spreadsheet.
Conclusion
This tutorial demonstrated how to clear a specific cell range in Excel and an entire sheet. You can quickly and efficiently perform customised tasks with VBA code as well. With Excel tutorials, you can master and use the program in your work and everyday life.
- Related Articles
- Reverse the order of the elements in the entire ArrayList or in the specified range in C#
- Reverse the order of the elements in the entire List or in the specified range in C#
- How to insert or display named range on another sheet
- How to clear an entire Treeview with Tkinter?
- How to Auto Copy and Paste Cell in the Current Sheet or From One Sheet to Another in Excel?
- How to clear filters when opening, saving or closing workbook in Excel?
- How to Convert an Excel Sheet or Cells to an HTML Table?
- How to get the next sheet name in Excel?
- How to Convert a Range to a Table or Vice Versa in Excel?
- How to Add Prefix or Suffix to a Range of Cells in Excel
- How to check if a shape or image exists in an active Excel sheet?
- How to Copy a Hidden Sheet in Excel?
- How to Automate an Excel Sheet in Python?
- How to clear restricted values in cells in Excel?
- How to add background color to headers or footers in an Excel sheet while printing
