How to Select Visible Cells in Excel (5 Quick Tricks)

When working with large data sets containing hidden cells, one can easily select the visible cells along with the hidden cells by dragging the mouse cursor horizontally and vertically over them. But it’s not that simple to select the visible cells only.

In this tutorial, we will demonstrate some methods to select just the visible cells in Excel.

how to select visible cells in excel


To demonstrate our methods, we’ll use the following dataset “Sales Report of ABC Technology”. There are some rows hidden in this dataset e.g. rows 6, 9, 10 and 12.

sales report of ABC technology with hidden rows

After unhiding the sheet, the entire dataset is visible to us. Our dataset has a total of 10 rows excluding the header row.

sales report of ABC technology

Note: This is a basic dataset to keep things simple. In a practical scenario, you may encounter a much larger and more complex dataset.


Limitations of Normal Copy-Pasting of Visible Cells in Excel

  • Select the B4:F14 range and press CTRL + C to copy it.

It appears we will be copying 7 rows here.

copying visible cells in Excel

  • Select cell B18 and press CTRL + V to paste the range.

pasting visible cells in Excel

All the hidden rows get pasted too.

all cells including hidden cells get pasted

Let’s use this dataset to select the visible cells only using various techniques.

We used Microsoft Excel 365, but you may use any other version at your disposal. Please leave a comment if any part of this article does not work in your version.


Method 1 – Using Keyboard Shortcut

This is the quickest method to select visible cells only in Excel.

Steps:

  • Drag and select the entire dataset (B4:F14).
  • Press the ALT + ; keys together.

selecting visible cells using semicolon key with ALT key

The range is selected. To prove that only the visible part is selected:

pressing CTRL+C to to copy selected cells

  • In cell B18 press CTRL + V to paste the data.

pasting visible selected cells using CTRL+V

Only the visible cells are pasted.

verification of select visible cells in excel using paste command


Method 2 – Using Go To Special Feature

The Go To Special feature in Excel can quickly find and select a specific type of cells, including only the visible cells.

Steps:

  • Select the dataset (B4:F14).
  • Navigate to the Home tab.
  • Under the Editing group of commands, click the Find & Select drop-down icon.
  • From the drop-down list, select the Go To Special option.

clicking on Go To Special command

  • In the Go To Special dialog box that opens, select Visible cells only and press OK.

This will exclude any hidden cell from the selection.

working on Go To Special dialog box

All the visible cells are selected.

visible cells selected in Excel

  • Like the previous method, use the Copy-Paste feature to verify the selection of visible cells only.

visible selected cells are pasted in sheet

Note: Press the F5 key to replicate the process, or the CTRL + G keyboard shortcut. 


Method 3 – Using Select Visible Cells Command from the Quick Access Toolbar

If we use a certain command frequently, we can add it to the Quick Access Toolbar. By default, this toolbar contains only 4 commands: Autosave, Save, Undo, and Redo, but we can add the Select Visible Cells option to this toolbar.

Steps:

  • Click on the down arrow icon which represents the Customize Quick Access Toolbar.
  • From the options, select More Commands.

customizing quick access toolbar in Excel

  • Select All Commands under the section Choose commands from.
  • Find the Select Visible Cells command and click on Add >>.

adding select visible cells command on QAT

The command is visible in the right side box, which means it’s now visible on the QAT.

  • Click OK.

select visible cells command added in QAT of Excel

A square-shaped icon that wasn’t present before is on the QAT. It’s the icon to Select Visible Cells.

Select visible cells icon available on quick access toolbar

  • Highlight the entire dataset and click on this icon.

clicking on select visible cells icon on QAT

Only the visible cells in the dataset are selected.

visible cells are selected only

  • Copy and paste as above to authenticate the selection of visible cells only.

pasting selected visible cells in excel


Method 4 – Using the Filter Feature

By applying a Filter to the dataset some rows are hidden, but we can select only the visible rows containing data.

Steps:

  • Select cell B4 (or any cell inside the dataset).
  • Click the Home tab >> Sort & Filter drop-down icon >> Filter.

applying filter option to dataset

A down arrowhead is added to all the column headers.

  • Click on the arrowhead beside the heading Product Name.
  • Unselect some items that will be hidden, and click OK.

selecting product name to be visible

Now only the selected products are visible in the worksheet.

using filter feature to hide some rows

  • Select the whole dataset and press CTRL + SHIFT + * on your keyboard to select only the visible cells.

pressing CTRL+SHIFT and asterisk button to select visible cells in Excel

  • Use the copy-paste technique to see the result.

pasting selected visible cells in Excel


Method 5 – Using VBA Code

We can apply VBA code in Excel to select visible cells by specifying a cell range to select.

Steps:

  • Go to the Developer tab.
  • Click the Visual Basic button in the Code group.

navigating to developer tab

The Microsoft Visual Basic for Applications window opens.

  • Click the Insert tab and choose Module from the list.

inserting new code module

A small Module window opens in which to insert our VBA code.

  • Copy the following code and paste it into the module:
Sub Select_visible_cells()
Range("B4:E14").Select
Selection.SpecialCells(xlCellTypeVisible).Select
End Sub

VBA code to select visible cells in Excel

Watch the following video to understand the rest of the process.

 


How to Select Visible Cells to Enter a Formula

In this section, we will explore how to select only the visible cells to enter formulas in Excel, even if cells, rows, or columns have been hidden by applying a filter or collapsing an outline.

Steps:

  • Select the range F5:F14.
  • Press ALT + ; to select the visible cells only.

pressing ALT key with semicolon key to select visible cells in Excel

  • In the first cell of the selected range, enter the following formula:
=D5*E5
  • Press CTRL + ENTER.

pressing CTRL+ENTER to insert formula to all visible cells in selected range

The formula is applied to all visible cells in the selected range.

select visible cells to enter formula in excel

  • Unhide the rows to confirm that just the visible cells were affected.

hidden cells are deprived of the formula


How to Select Only Filtered Cells to Enter Formula in Excel

Now we’ll use the AGGREGATE function in an Excel formula to apply it only to the filtered cells.

Steps:

  • Apply a Filter to filter out some data.

applied filter in dataset

We want to calculate the average Sales of the visible cells in cell D16.

  • In cell D16, enter =AGGREGATE(.
  • Select 1 – AVERAGE as the function_num argument.

using AGGREGATE function in Excel

  • Enter a comma after 1, and select 5 – Ignore hidden rows as the options argument.
  • Enter ) to finish the formula.
  • Press ENTER.

giving argument to ignore hidden rows in excel

The final form of the formula is as follows:

=AGGREGATE(1,5,F5:F14)

select only filtered visible cells to enter formula in Excel

  • To verify that the formula is showing the average of visible cells only, clear the Filter from the dataset.

The result changes as the hidden cells become visible..

different result on same formula when filter is removed


Advantages to Selecting Visible Cells in Excel

  • Prevents Errors: When working with large datasets in Excel, it is common to apply filters, hide rows or columns, or use conditional formatting to highlight specific cells. If you copy and paste the entire range without selecting only the visible cells, you may inadvertently copy hidden or filtered cells, leading to errors in your analysis or calculations.
  • Saves Time: Selecting visible cells in Excel can save you a lot of time, especially when dealing with large datasets. By copying and pasting only the visible cells, you can avoid copying unnecessary data and focus only on the information you need.
  • Improves Data Accuracy: When you select only the visible cells in Excel, you can be confident that you are working with accurate and relevant data. This is particularly important when working with datasets that contain missing or incomplete data.
  • Provides Better Data Insights: You can get a better understanding of your data and draw more accurate conclusions, because you are working with a subset of the data that is relevant to your analysis, rather than the entire range.

Things to Remember

  • Selecting visible cells does not remove any hidden data, so be careful when copying and pasting.
  • Make sure that your data is formatted correctly to avoid any errors when selecting visible cells.
  • Make sure to spell the VBA in-built functions properly.
  • If you are a Mac user, use the keys Cmd + Shift + Z instead of ALT + ;.
  • If any cells are hidden due to filtering, the above methods are unnecessary as Excel will exclude them by default.

Frequently Asked Questions

1. Why can’t I select visible cells only in Excel?

Make sure that you have applied the filter correctly before selecting visible cells. Also, check that you are using the correct keyboard shortcuts or features to select visible cells.

2. Can I select only visible cells in a specific range in Excel?

Yes. Select the range where you want to select only visible cells, then use the Go To Special feature or keyboard shortcuts.

3. Will selecting visible cells only remove hidden data in Excel?

Answer: No, selecting visible cells only will leave the hidden cells untouched.


Download Practice Workbook


Related Articles


<< Go Back to Excel Cells | Learn Excel

Get FREE Advanced Excel Exercises with Solutions!
Nazmul Hossain Shovon
Nazmul Hossain Shovon

Nazmul Hossain Shovon, a BUET graduate in Naval Architecture and Marine Engineering, embarked on his career with 8 months dedicated to the Exceldemy project's triumph. Transitioning into a Software Developer role, he specialized in web add-in development. At Exceldemy, he authored about 125 blog articles and solved many visitors’ problems, refining his writing skills and delving into Excel-related topics. With a primary passion for programming and software development, Shovon continually explores new horizons, fostering professional growth in his... Read Full Bio

We will be happy to hear your thoughts

Leave a reply

Advanced Excel Exercises with Solutions PDF

 

 

ExcelDemy
Logo