3 Ways to Freeze and Unfreeze Rows or Columns in Google Sheets

Google Sheets is a great tool for managing your data. But have you ever needed to keep a row or column fixed while scrolling through your Google Sheets?

Sometimes you may need to view the data at the end of your sheet while still maintaining a view of the top.

Google Sheets has a feature that allows you to freeze rows and columns so that important information like column headings don’t scroll off the screen when you are viewing certain parts of the spreadsheet.

This can be especially helpful when you are working with large datasets!

This blog post will show you how to use the freeze panes feature in Google Sheets effectively!

Make sure to use the above link to get the example workbook to help you practice.

Freeze Rows or Columns Using the Mouse

One way you can freeze a Google Sheets row or column is by using the mouse!

To do this, move your mouse cursor to the square over to where the row and column headings intersect. This will cause your cursor to change into a hand icon and you will see either a horizontal or vertical light blue bar.

Now you can click and drag the line to freeze either the row or column.

Unfreeze Rows or Columns Using the Mouse

Unfreezing rows or columns is just as easy with the mouse.

To unfreeze rows or columns, all you need to do is simply click and drag the bar back to the row and column heading intersection.

When you hover the mouse cursor over the frozen row or column bar indicator, the cursor will again turn into a small hand icon and you can click and drag the bar back to its origin.

It’s that easy!

Freeze Rows or Columns from the View Menu

Another way to freeze Google Sheets rows or columns is by using the View menu!

Follow these steps to freeze rows or columns.

  1. Click on the View tab in the menu.
  2. Select Freeze from the options.
  3. Choose either of the options: 1 row, 2 rows or Up to the current row. Similar options exist for columns as well.

If you select 1 row or 2 rows then the top row or top 2 rows will appear frozen at the top of the spreadsheet when you scroll down. These are great preset options when you have a data list with column headings.

If you select Up to current row, then the number of rows that will be kept frozen at the top will depend on where your active cell cursor is located. Any rows on or above the active cell will get frozen at the top of your sheet.

Similarly, selecting Up to current column will freeze any columns on or to the left of the active cell.

Unfreeze Rows or Columns from the View Menu

If you already have frozen rows or columns in your sheet and you would like to remove them, this can also be done from the View tab menu.

To unfreeze rows or columns, follow these steps.

  1. Click on the View tab menu.
  2. Select Freeze from the options.
  3. Select either No rows or No columns.

The frozen rows or columns will be removed.

Unfortunately, if you’ve got both frozen rows and columns. You will need to do this twice as there is no option to remove both rows and columns at the same time.

Freeze Rows or Columns Using an Apps Script

Freezing rows or columns can also be controlled using Apps Scripts.

This way you can easily toggle on and off frozen rows and columns at the same time.

To do this click on the Tools menu then select Script editor from the options.

function freezePanes() {
  var sheet = SpreadsheetApp.getActiveSheet();
  sheet.setFrozenRows(1);
  sheet.setFrozenColumns(1);
}

This will open up the script editor and you can place the above code inside and run it.

This code will freeze both the first row and column of the active sheet.

Unfreeze Rows or Columns Using an Apps Script

Nearly the same apps script code can be used to unfreeze the rows and columns.

function freezePanes() {
  var sheet = SpreadsheetApp.getActiveSheet();
  sheet.setFrozenRows(0);
  sheet.setFrozenColumns(0);
}

You just need to change the index referenced in the setFrozenRows and setFrozenColumns functions of the script.

Setting these to 0 will essentially remove any frozen rows or columns on the sheet.

Conclusions

With Google Sheets, it’s easy to freeze rows or columns to help you keep the important information visible when scrolling.

Google Sheets has two different ways to do this, either with the mouse or from the View menu.

You can even automate this using a simple apps script.

Do you use this feature? Let us know in the comments below!

Next: Check out how to add alternating row colors to your datasets. This is another great feature for making your data easier to view!

About the Author

John MacDougall

John MacDougall

John is a Microsoft MVP and freelance consultant and trainer specializing in Excel, Power BI, Power Automate, Power Apps, and SharePoint. You can find other interesting articles from John on his blog or YouTube channel.

Related Articles

Comments

0 Comments

Get the Latest Google Sheets Tips

Write For Us

Are you a tech enthusiast with a talent for writing great content? Come write for us!

Follow Us

Follow us on social media to stay up to date with the latest in Google Sheets!