In this article we’ll discuss 5 methods to select all cells containing data in a column, and 3 related keyboard shortcuts. We’ll use the following dataset to illustrate.
Method 1 – Using Go To Special Command
Steps:
- Select the cells of the Name column.
- Go to the Editing group from the Home tab.
- Click on the Find & Select option.
- Choose Go to Special from the list.
The Go to Special window will appear.
- Choose Constants from the list.
- Click OK.
The cells with data are selected.
There are alternative ways to access the Go To Special tool:
- Press Ctrl+G or F5 to open the Go To dialog box.
- Click the Special option.
The Go To Special window will appear.
Read More: Select All Cells with Data in Excel
Method 2 – Using Excel Table Feature
Steps:
- Press Ctrl+T to create a table.
The Create Table dialog box will appear.
- Choose the column range from the dataset.
- Tick the My table has headers box.
- Click OK.
A Filter sign will show in the Name heading cell.
- Press the down arrow sign.
- Untick the Blanks option from the list.
- Click OK.
Only cells with data are displayed.
We can also use Ctrl + L to create a table.
Read More: How to Select Cells with Certain Value in Excel
Method 3 – Using Filter Command
Steps:
- Select the Name column.
- Go to the Editing group in the Home tab.
- Select the Sort & Filter option.
- Choose Filter from the list.
A Filter is available on the Name heading.
- Click on the down arrow.
- Untick Blanks from the list.
- Click OK.
Only cells with data in the Name column are showing.
We can also access the Filter via the keyboard shortcut Ctrl + Shift + L.
Read More: How to Select Random Cells in Excel
Method 4 – Using Conditional Formatting
Steps:
- Select the cells of the Name column.
- Go to Conditional Formatting on the Home tab.
- Choose More Rules from the Highlight Cells Rules list.
A New Formatting Rule dialog box will appear.
- Set No Blanks from the Format only cells with drop-down list.
- Click Format.
A Format Cells dialog box will appear.
- Go to the Fill tab.
- Choose a color.
- Click OK.
- Click OK to implement the condition.
Cells with data are highlighted.
Read More: How to Select Blank Cells in Excel and Delete
Method 5 – Using VBA Code
Steps:
- Go to the Developer tab.
- Select the Record Macro option.
- Set the name of the Macro and click OK.
- Click the Macros option.
- Select the macro and Step Into it.
- Copy and paste the following VBA code into the module:
Sub Select_Data_Cells()
Dim range_1, range_2, range_3 As Range
Set range_2 = Application.Selection
Set range_2 = Application.InputBox("Range", xTitleId, range_2.Address, Type:=8)
For Each range_1 In range_2
If range_1.Value <> "" Then
If range_3 Is Nothing Then
Set range_3 = range_1
Else
Set range_3 = Union(range_3, range_1)
End If
End If
Next
If Not range_3 Is Nothing Then
range_3.Interior.ColorIndex = 37
End If
End Sub
- Press F5 to run the code.
A dialog box will appear to input the range.
- Select the range from the dataset.
- Click OK.
The cells containing data are highlighted in the dataset.
Read More: How to Select Highlighted Cells in Excel
3 Related Keyboard Shortcuts
Shortcut 1 – Select All Cells in a Column
Steps:
- To select the cells of Column D, go to Cell D7.
- Press Ctrl + Space bar.
The entire column is selected.
Shortcut 2 – Choose Contiguous Data Cells
This keyboard shortcut is applicable when we have contiguous data in a column. As soon as a blank is found, the operation will stop.
Steps:
- Go to Cell B5.
- Press Ctrl +Shift + Down arrow.
All cells in the column until the first blank cell are selected.
Shortcut 3 – Select All Cells in the Dataset
Steps:
- Select any cell of the dataset, for example Cell B5.
- Press Ctrl + A.
All the cells of the data set are selected. Press Ctrl+A again to select the entire worksheet.
Download Practice Workbook
Related Articles
- How to Select Only Filtered Cells in Excel Formula
- [Fixed!] Selected Cells Not Highlighted in Excel
- Selecting Non-Adjacent or Non-Contiguous Cells in Excel
<< Go Back to Select Cells | Excel Cells | Learn Excel
Get FREE Advanced Excel Exercises with Solutions!