In Microsoft Excel, deselecting means removing the active selection of cells or a range of cells in the worksheet. Deselecting cells can be useful when you want to remove a selection or range of cells you have previously selected to perform certain operations. Today in this article, I am sharing with you how to deselect in Excel. Stay tuned!
In the following, you will find an overview of how to deselect in Excel.
Download Practice Workbook
You can download our practice workbook from here for free!
How to Deselect in Excel: 2 Fast Ways
Below in this article, I am explaining 2 quick and easy ways to deselect in Excel.
Suppose we have a dataset of some Student ID, Name, Department, Age, and their GPA. Now we will select the whole dataset and then deselect cells, rows, and columns using this data table.
1. Using CTRL Key to Deselect Multiple Cells/Columns/Rows
You can use the CTRL key to deselect specific cells or ranges of cells from a larger selection. This feature can be useful when you have selected a large range of cells, but need to remove one or more cells, columns from that selection to perform certain operations.
1.1 Deselect Multiple Cells from Selected Range
In order to deselect multiple cells from a chosen range, follow the instructions below.
Steps:
- First, choose the whole range of cells and hold the CTRL key.
- Then, click on the cells which you want to deselect. That’s it. Your clicked cells are deselected from the cell range.
Note: If you are using Mac, then use the Command button (Cmd) instead of the CTRL key.
1.2 Deselect Multiple Columns (Contiguous or Non-Contiguous)
In the same fashion, you can deselect multiple columns in your Excel worksheet.
Steps:
- Start with, selecting the whole range of cells and holding the CTRL key from the keyboard.
- Hence, double-click column number from the top of the worksheet to deselect columns.
- For deselecting multiple non-adjacent columns we will go through the same procedure.
- Similarly, select the whole range of cells and hold the CTRL key.
- Thereafter, you can double-click column numbers from the top of the worksheet to deselect non-contiguous columns.
Read More: How to Select Columns with VBA (3 Easy Ways)
1.3 Deselect Rows After Copying
In Microsoft Excel, you can also deselect rows after copying.
Steps:
- Choose your desired range of cells and hold the CTRL key.
- Then, double click row numbers from the right side of the worksheet to deselect.
- Thereafter, click the Copy option from the Advanced options to copy.
- Then, choose a cell and paste it without the rows which you deselected. Simple isn’t it?
Read More: Excel VBA Select Row Based on Cell Value (3 Ways)
2. Inserting VBA Code
In Excel, when you select a cell or range of cells, they become highlighted to indicate that they are the active selection. However, there may be times when you want to remove the selection from those cells. To do this using VBA, you can write a short program that will deselect the cells you clicked.
Steps:
- First, hit the Visual Basic option from the Developer tab to open Microsoft Visual Basic for Applications.
- Hence, click the Module option from the Insert tab.
- Inside the module place the following code and click the Run icon.
Sub Deselect_Cells()
Dim cellRange As Range
Dim inputRange As Range
Dim deselectRange As Range
Dim outputRange As Range
xTitleId = "Deselect Cells"
Set inputRange = Application.Selection
Set inputRange = Application.InputBox("Please select a range:", _
xTitleId, inputRange.Address, Type:=8)
Set deselectRange = Application.InputBox("Please select the cells to deselect:", _
xTitleId, Type:=8)
For Each cellRange In inputRange
If Application.Intersect(cellRange, deselectRange) Is Nothing Then
If outputRange Is Nothing Then
Set outputRange = cellRange
Else
Set outputRange = Application.Union(outputRange, cellRange)
End If
End If
Next cellRange
outputRange.Select
End Sub
- An InputBox will pop-up where you can choose your desired range of cells. After choosing, press OK.
- Hence, another InputBox will come up where you can choose cells to deselect.
- Finally your chosen cells are deselected. It’s that simple.
Read More: Excel VBA: Select All Cells with Data
How to Select Cells/Ranges in Excel
Selecting cells or ranges is a basic operation that allows you to perform various actions such as editing, formatting, or manipulating data in the worksheet. There are several ways to select cells or ranges in Excel, depending on the specific task you want to perform. In this part, I am sharing a simple trick to select cells within a glimpse of an eye.
Steps:
- Choose the top cell from where you want to start selecting cells.
- Then holding the SHIFT key click any cell to select a range of cells.
- As a result, you will find all the cells are selected between the chosen cells.
Read More: How to Select Range Based on Cell Value VBA (7 Ways)
Excel Deselect Cells Not Working: How to Fix It
Sometimes you will face problems while deselecting cells. This might happen for multiple reasons. If you are in Edit Mode and trying to deselect, then Excel may not respond to your deselection commands. You just need to cancel the edit mode and keep continuing your deselection work.
Further, while holding the CTRL key, if you click any cell to deselect it, you will see the cells getting darker, meaning multiple time selection for the cell. This happens if you are using an earlier version of Microsoft Excel.
Things to Remember
- If you have already selected cells or ranges in Excel, you can deselect them by clicking on any other cell or range in the worksheet.
- Pressing the ESC key on your keyboard will also deselect any cells or ranges that you have selected in Excel.
- If you want to deselect a range of cells, you can hold down the SHIFT key on your keyboard and click on any cell in the range that you want to deselect. This will deselect the entire range.
- If you have selected the entire worksheet and want to deselect it, you can use the CTRL+A shortcut to select all cells, and then press CTRL+A again to deselect them.
Frequently Asked Questions
1. Can I deselect multiple ranges of cells at once in Excel?
The answer is no, you cannot. You can only deselect one range of cells at a time.
2. Can I deselect cells while keeping the current selection intact in Excel?
No, it’s not possible. At the time of deselecting other cells, the previous selection will be removed.
3. Can I use a formula or function to deselect cells in Excel?
No, there is no function available for deselecting cells in Excel. Deselecting cells is a manual process which can only be done by the user.
Conclusion
In conclusion, deselecting cells in Excel is a basic operation that allows you to remove a previously selected cell or range of cells from the active selection. There are several ways to deselect cells in Excel, including clicking on an unselected cell, using the ESC key, using the CTRL key to deselect specific cells or ranges, or using the SHIFT key to deselect a specific cell within a range. Take a tour of the practice workbook and download the file to practice by yourself. Please inform us in the comment section about your experience. We, the Exceldemy team, are always responsive to your queries. Stay tuned and keep learning.