Skip to main content

Excel: Hide Rows If Any Cell Is Blank in a Range

Author Xiaoyang Last modified

Blank cells within your data can interfere with calculations, charts, and reporting. If you want to clean up your worksheet by hiding any row that contains one or more blank cells, Excel offers multiple solutions—ranging from built-in tools to VBA automation. This guide walks you through the most effective methods.

Use Go To Special feature to hide rows with any blank cells

Use Kutools AI to hide rows with any blank cells

Use VBA code to hide rows with any blank cells


Use Go To Special feature to hide rows with any blank cells

With the Go To Special function, you can select the blank cells first and then apply the short cut keys to hide the rows which contain blank cells. Please do with following steps:

  1. Select the data range which contains the blank cells you want to hide.
  2. Then click Home > Find & Select > Go To Special. (You also can press Ctrl + G to open Go To dialog and click Special to get the Go To Special dialog.) See screenshot:
    go to special option
  3. And in the Go To Special dialog, select Blanks option, and then click OK button.
    select blank option
  4. All of the blank cells in the selection have been selected, see screenshot:
    all blank cells are selected
  5. Then you can press Ctrl + 9 keys together to hide the rows which have blank cells.
    Ctrl + 9 to hide the rows with blank cells

Use Kutools AI to hide rows with any blank cells

Kutools for Excel’s Kutools AI Aide combines the flexibility of Excel with the intelligence of an AI assistant. Unlike traditional methods that require formulas or VBA code, Kutools AI allows you to describe what you want to do in plain English—and it takes care of the rest.

Kutools for Excel offers over 300 advanced features to streamline complex tasks, boosting creativity and efficiency. Itegarate with AI capabilities, Kutools automates tasks with precision, making data management effortless. Detailed information of Kutools for Excel...         Free trial...
  1. After installing Kutools for Excel, please click Kutools AI > AI Aide to open the Kutools AI Aide pane.
  2. Then, highlight the range of rows and columns you want to scan.
  3. In the Kutools AI input box, type a natural language command such as:
    Hide rows if there are any blank cells in the selected range
    type a command into the chatbox
  4. Click Send or press Enter. Kutools AI will analyze your requirement, after analyzing, click Execute button, the rows contain blank cells are hidden at once.
    go to special option

Use VBA code to hide rows with any blank cells

The following vba code allows you to hide rows if any cell in a specified range is blank.

  1. Press Alt + F11 keys to display Microsoft Visual Basic for Applications window.
  2. Click Insert > Module, and paste below code to the new Module window.
    Sub HideRowsWithAnyBlankCells()
    'Updateby Extendoffice
        Dim ws As Worksheet
        Dim rng As Range, rowRange As Range
        Dim i As Long
        Set ws = ActiveSheet
        On Error Resume Next
        Set rng = Application.InputBox( _
            Prompt:="Please select the range to check for blank cells:", _
            Title:="KutoolsforExcel", _
            Type:=8)
        On Error GoTo 0
        If rng Is Nothing Then
            MsgBox "No range selected. Macro canceled.", vbExclamation
            Exit Sub
        End If
        Application.ScreenUpdating = False
        For i = 1 To rng.Rows.Count
            Set rowRange = rng.Rows(i)
            If Application.WorksheetFunction.CountBlank(rowRange) > 0 Then
                rowRange.EntireRow.Hidden = True
            End If
        Next i
        Application.ScreenUpdating = True
        MsgBox "Rows with any blank cells have been hidden.", vbInformation
    End Sub
    
  3. Press F5 key to run the code, a dialog pops out for you to select a range check the blank cells.
    vba code to select a range for use
  4. Click OK. All rows in the selected range that contain at least one blank cell will be hidden.

🔚 Conclusion

Whether you're managing a small table or a large dataset, hiding rows with any blank cells can significantly improve data clarity and prevent errors in analysis. The method you choose depends on your needs and expertise:

  • Use Go To Special for quick, manual review and selective hiding.
  • Leverage Kutools AI for a smart, code-free solution using natural language commands.
  • Apply VBA code for automated, repeatable row-hiding based on blanks.

Each method offers a unique advantage—choose the one that best fits your workflow for faster and cleaner data management in Excel. If you're interested in exploring more Excel tips and tricks, our website offers thousands of tutorials to help you master Excel.


Related articles:

How to shade or color blank cells in Excel?

How to select blank cells from a range in 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 Toolsets12 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
Use Kutools in your preferred language – supports English, Spanish, German, French, Chinese, and 40+ others!

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...


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!