Home / Blog / Hide Empty Columns

How to Automatically Hide Empty Columns and Rows in Google Sheets

đź“‹ Table of Contents

  1. The Visual Noise of Empty Cells
  2. Method 1: Hiding Rows Using Built-In Filters
  3. Method 2: Using Google Apps Script to Hide Empty Columns
  4. Method 3: Zero-Code Automated View Rules with CleanSheet
  5. Keep Your Dashboard Focused
  6. Frequently Asked Questions

The Visual Noise of Empty Cells

A default Google Sheet starts with 1,000 rows and 26 columns (A to Z). But most tracking sheets, dashboards, and client intake logs only require a small fraction of that grid. Having endless blank spaces, unused columns at the end, or empty rows makes scrolling frustrating and makes sheets look messy.

Hiding empty rows and columns keeps your team focused, improves performance when loading spreadsheets on mobile, and creates a neat, professional dashboard view.

Method 1: Hiding Rows Using Built-In Filters

To temporarily hide empty rows, you can use basic filters:

  1. Highlight your header row and click on Data > Create a Filter.
  2. Click the green filter icon on the column containing blank entries.
  3. Uncheck (Blanks) and click OK.

This works great for individual review. However, filters do not hide empty columns. Also, standard filters apply to all collaborators, which might disrupt team members who are trying to enter new data.

đź’ˇ Pro Tip

Use Filter Views (Data > Filter views > Create new filter view) instead of standard filters. This hides empty rows just for you, without changing the view for other team members.

Method 2: Using Google Apps Script to Hide Empty Columns

If you want to automatically hide columns that do not have any values, you can write a custom Google Apps Script. Open Extensions > Apps Script and enter the following function:

function hideEmptyColumns() {
  var sheet = SpreadsheetApp.getActiveSpreadsheet().getActiveSheet();
  var maxCols = sheet.getMaxColumns();
  var maxRows = sheet.getMaxRows();
  
  for (var c = 1; c <= maxCols; c++) {
    var range = sheet.getRange(1, c, maxRows, 1);
    var values = range.getValues();
    var isEmpty = true;
    for (var r = 0; r < values.length; r++) {
      if (values[r][0] !== "") {
        isEmpty = false;
        break;
      }
    }
    if (isEmpty) {
      sheet.hideColumns(c);
    }
  }
}
    

While effective, custom scripts must be triggered manually or run on daily time timers. If columns are hidden and you need to type new values, you must manually go and unhide them, which is a repetitive task.

Method 3: Zero-Code Automated View Rules with CleanSheet

To automate the visibility of rows and columns based on custom business rules (e.g. automatically hide task columns that are empty, or hide rows that are finished, but keep them open when you select a checkbox) without custom scripts, use CleanSheet.

Inside the CleanSheet sidebar, create a new rule:

Keep Your Dashboard Focused

Hiding empty rows and columns is a quick win for spreadsheet UI design. Choose the method that fits your technical skills—manual filter views for quick checks, Apps Script for developer setups, or CleanSheet for a fully automated, hands-free workspace.

Frequently Asked Questions

Can I hide empty rows without affecting other collaborators' view?

Yes. Use Filter Views (Data > Filter views > Create new filter view) instead of a standard filter. A filter view only changes what you see, so other people editing the sheet at the same time still see every row.

Does Google Sheets have a built-in way to hide empty columns automatically?

No, there is no native one-click setting for this. You have to either hide columns manually, write an Apps Script that scans each column and hides the empty ones, or use an add-on like CleanSheet that applies hide/unhide rules automatically based on whether a column or row contains data.

What happens if I add new data to a row that CleanSheet has hidden?

CleanSheet re-evaluates your hide rules on its schedule, so once a previously empty row receives new values, the next scheduled run automatically unhides it — you don't need to manually find and reveal the row yourself.

Related Articles

🤖 Maintain Pristine Spreadsheet Layouts

CleanSheet manages column and row visibilities dynamically, ensuring your active sheet is always tidy.

Install CleanSheet Free