How to Select All Cells with Data in Excel (5 Methods)

Method 1 – Select All Cells with Values Using the ‘Go To Special’ Command

The dataset below has data on several areas of fruit sales date-wise. However, it has some blank cells. We will select all the non-contiguous cells with data using Excel’s ‘Go To Special’ command.

Select All Cells with Values Using ‘Go To Special’ Command in Excel

Steps:

  • Select the entire dataset (B4:E14).

Select All Cells with Values Using ‘Go To Special’ Command in Excel

  • From Excel Ribbon, go to Home > Editing > Find & Select > Go To Special.

Select All Cells with Values Using ‘Go To Special’ Command in Excel

  • As a result, the ‘Go To Special‘ dialog box will appear.
  • Choose the Constants option and press OK.

Select All Cells with Values Using ‘Go To Special’ Command in Excel

  • Once you press OK, Excel will highlight all the cells with data by default.

Read More: Select All Cells with Data in a Column in Excel 


Method 2 – Excel VBA to Select All Cells with Data

Steps:

  • Go to the worksheet that contains the dataset.
  • Right-click on the corresponding sheet name and select View Code.

Excel VBA to Select All Cells with Data

  • The VBA window will open up.
  • Type the code below in the Module and run the code using the F5 key. Or you can use the Run Sub/UserForm icon to run the code.
Sub SelectwithData()
Dim abc As Range
Dim WorkRange As Range
Dim OutRange As Range
On Error Resume Next
xTitleId = "Select Cells with Data"
Set WorkRange = Application.Selection
Set WorkRange = Application.InputBox("DataRange", xTitleId, WorkRange.Address, Type:=8)
For Each abc In WorkRange
    If abc.Value <> "" Then
        If OutRange Is Nothing Then
            Set OutRange = abc
        Else
            Set OutRange = Union(OutRange, abc)
        End If
    End If
Next
If Not OutRange Is Nothing Then
    OutRange.Select
End If
End Sub

Excel VBA to Select All Cells with Data

  • Upon running the code, the following message box will pop up.
  • Enter the dataset range and press OK.

Excel VBA to Select All Cells with Data

  • You will see that all the cells that have data are highlighted below.

Read More: How to Select Cells with Certain Value in Excel


Method 3 – Select All Cells with Specific Data Using Excel Find Option

Steps:

  • Select any cell in the sheet where you have the dataset.

Select All Cells with Specific Data Using Excel Find Option

  • Press Ctrl + F to bring up the Find and Replace dialog box.
  • From the Find tab, type ‘Apple’ in the Find what field.
  • Press Find All.

Select All Cells with Specific Data Using Excel Find Option

  • Clicking on Find All will give you the list of cell references with ‘Apple’ in them.
  • Press Ctrl + A to select the entire list.
  • You will see all the cells with ‘Apple’ highlighted when the result of Find All is selected.

Read More: How to Select Random Cells in Excel


Method 4 – Select All Cells with Data Using Mouse Cursor

Steps:

  • Put the mouse cursor in the dataset’s first cell (here, B4).

Select All Cells with Data Using Mouse Cursor

  • Drag the cursor to the dataset’s end cell (here, E14). Excel will auto-select the entire dataset.

Read More: How to Select Highlighted Cells in Excel 


Method 5 – Use the Keyboard Shortcut to Select All Cells with Data

Steps:

  • Select any cell of the dataset. I have selected cell C5.

Use Keyboard Shortcut to Select All Cells with Data

  • Press Ctrl + A. The whole dataset is highlighted as we have data in each cell of this dataset.

Read More: How to Select Blank Cells in Excel and Delete 


Download the Practice Workbook

You can download the workbook to practice.


Related Articles


<< Go Back to Select Cells | Excel Cells | Learn Excel

Get FREE Advanced Excel Exercises with Solutions!
Hosne Ara
Hosne Ara

Hosne Ara is a materials and metallurgical engineer who loves exploring Excel and VBA programming. To her, programming is like a time-saving superhero for dealing with data, files, and the internet. She's skilled in Rhino3D, Maxsurf C++, MS Office, AutoCAD, and Excel & VBA, going beyond the basics. With a B. Sc. in Materials and Metallurgical Engineering from Bangladesh University of Engineering and Technology, she's shifted gears and now works as a content developer. In this role, she... Read Full Bio

We will be happy to hear your thoughts

Leave a reply

Advanced Excel Exercises with Solutions PDF

 

 

ExcelDemy
Logo