How to filter a list and delete the rest hidden or visible rows in Excel? For a filtered list, you may need to delete the hidden or visible rows in order to keep only the useful data. In this article, we will show you methods of deleting the rest hidden or visible rows of a filtered list in Excel. Delete hidden rows in active worksheet with VBA code Delete visible rows of filtered list with selecting all visible cellsEasily delete hidden or visible rows of filtered list with Kutools for Excel Delete hidden rows in active worksheet with VBA code This section will show you VBA code to delete hidden rows in active sheet. Please do as follows. 1. Activate the worksheet you need to delete hidden rows, press Alt + F11 keys simultaneously to open the Microsoft Visual Basic for Applications window. 2. In the Microsoft Visual Basic for Applications window, click Insert > Module. And then copy and paste the below VBA code into the Module window. VBA code: Delete hidden rows Sub RemoveHiddenRows() Dim xRow As Range Dim xRg As Range Dim xRows As Range On Error Resume Next Set xRows = Intersect(ActiveSheet.Range("A:A").EntireRow, ActiveSheet.UsedRange) If xRows Is Nothing Then Exit Sub For Each xRow In xRows.Columns(1).Cells If xRow.EntireRow.Hidden Then If xRg Is Nothing Then Set xRg = xRow Else Set xRg = Union(xRg, xRow) End If End If Next If Not xRg Is Nothing Then MsgBox xRg.Count & " hidden rows have been deleted", , "Kutools for Excel" xRg.EntireRow.Delete Else MsgBox "No hidden rows found", , "Kutools for Excel" End If End Sub 3. Press the F5 key to run the code. If there are hidden rows in active sheet, after running the code, a dialog box will pop up to tell you how many hidden rows have been deleted. Click the OK button to delete the hidden rows. See screenshot: Otherwise, you will get the following dialog box after running the code. Note: the above VBA code not only can delete hidden rows of filtered list, but also delete hidden rows which you have manually hidden before. /* 电脑端布局:图片在左边,文字在右边 */ @media (min-width: 900px) { .container { display: flex; align-items: flex-start; } .image-container { flex: 0 0 auto; margin-right: 20px; } .text-container { flex: 1; padding-top: 10px; padding-bottom: 11px; padding-left: 20px; } } /* 手机端布局:图片在上面,文字在下面 */ @media (max-width: 899px) { .container { display: block; } .image-container { margin: 0 auto; text-align: center; padding-bottom: 20px; } .text-container { padding: 10px 20px; } } Unlock Excel Magic with Kutools AI Smart Execution: Perform cell operations, analyze data, and create charts—all driven by simple commands. Custom Formulas: Generate tailored formulas to streamline your workflows. VBA Coding: Write and implement VBA code effortlessly. Formula Interpretation: Understand complex formulas with ease. Text Translation: Break language barriers within your spreadsheets. Enhance your Excel capabilities with AI-powered tools. Download Now and experience efficiency like never before! Delete visible rows of filtered list with selecting all visible cells feature For deleting visible rows of filtered list, please do as follows. 1. Select all filtered out rows, and press F5 key to open the Go To dialog box, then click the Special button. See screenshot: 2. In the Go To Special dialog box, check the Visible cells only option, and then click the OK button. 3. Now all visible rows are selected, right click the selection, and then click Delete Rows. Until now, all visible rows are deleted from the filtered list. Easily delete hidden or visible rows of filtered list with Kutools for Excel The above two methods may be not the desire solutions for many Excel users, here we introduce you a handy tool. With the Delete Hidden (Visible) Rows & Columns utility of Kutools for Excel, you can easily delete hidden rows in selected range/sheets, active sheet or all worksheets in Excel. Kutools for Excel offers over 300 advanced features to streamline complex tasks, boosting creativity and efficiency. Enhanced with AI capabilities, Kutools automates tasks with precision, making data management effortless. Detailed information of Kutools for Excel... Free trial... 1. If you only want to delete hidden or visible rows of a filtered list, please select the filtered range manually, and then click Kutools > Delete > Delete Hidden (Visible) Rows & Columns. See screenshot: 2. In the Delete Hidden (Visible) Rows & Column dialog box, keep the In selected Range selected in the Look in drop-down list (you can select other options as you need), check the Rows option in the Delete type section, and in the Detailed type section, check Visible rows or Hidden rows option as you need. And finally click the OK button. 3. Then a dialog box pops up to tell you how many rows have been deleted, please click the OK button. If you want to have a free trial ({snippet alias="kte-free-trial"}-day) of this utility, please click to download it, and then go to apply the operation according above steps. Delete hidden or visible rows of filtered list with Kutools for Excel Best Office Productivity Tools 🤖 Kutools AI Aide: Revolutionize data analysis based on: Intelligent Execution | Generate Code | Create Custom Formulas | Analyze Data and Generate Charts | Invoke Kutools Functions… Popular Features: Find, Highlight or Identify Duplicates | Delete Blank Rows | Combine Columns or Cells without Losing Data | Round without Formula ... Super Lookup: Multiple Criteria VLookup | Multiple Value VLookup | VLookup Across Multiple Sheets | Fuzzy Lookup .... Advanced Drop-down List: Quickly Create Drop Down List | Dependent Drop Down List | Multi-select Drop Down List .... Column Manager: Add a Specific Number of Columns | Move Columns | Toggle Visibility Status of Hidden Columns | Compare Ranges & Columns ... Featured Features: Grid Focus | Design View | Big Formula Bar | Workbook & Sheet Manager | Resource Library (Auto Text) | Date Picker | Combine Worksheets | Encrypt/Decrypt Cells | Send Emails by List | Super Filter | Special Filter (filter bold/italic/strikethrough...) ... Top 15 Toolsets: 12 Text Tools (Add Text, Remove Characters, ...) | 50+ Chart Types (Gantt Chart, ...) | 40+ Practical Formulas (Calculate age based on birthday, ...) | 19 Insertion Tools (Insert QR Code, Insert Picture from Path, ...) | 12 Conversion Tools (Numbers to Words, Currency Conversion, ...) | 7 Merge & Split Tools (Advanced Combine Rows, Split Cells, ...) | ... and more Supercharge Your Excel Skills with Kutools for Excel, and Experience Efficiency Like Never Before. Kutools for Excel Offers Over 300 Advanced Features to Boost Productivity and Save Time. Click Here to Get The Feature You Need The Most... More details of Kutools for Excel... Free Download... Office Tab Brings Tabbed interface to Office, and Make Your Work Much Easier Enable tabbed editing and reading in Word, Excel, PowerPoint, Publisher, Access, Visio and Project. Open and create multiple documents in new tabs of the same window, rather than in new windows. Increases your productivity by 50%, and reduces hundreds of mouse clicks for you every day! More details of Office Tab... Free Download...