Yes, you can lock rows in Google Sheets to prevent accidental edits or deletions, and the most common method is using the Format menu to select specific cells that will remain static while others remain editable. This is often called "protecting" the data range. You do not need any special software or add-ons; the core functionality is built into the standard web interface and the mobile app.

What You'll Need

  • A Google account (to access Sheets).
  • Access to a web browser on a computer or the Google Sheets mobile app on a smartphone or tablet.
  • Basic knowledge of selecting ranges of cells within a spreadsheet.

Step-by-Step

The following steps describe the process on a computer using a web browser. The steps for the mobile app are slightly different and are covered at the end of this guide.

  1. Open your spreadsheet. Navigate to the specific Google Sheet you wish to edit. If the sheet is shared with you, ensure you have edit access; protection settings cannot be applied if you are a Viewer only.
  2. Select the rows or cells you want to lock. Click and hold your mouse button on the row number on the far left side of the sheet to highlight the entire row. Alternatively, click a single cell to lock just that specific data point. You can hold the Shift key and click another row to select non-contiguous rows.
  3. Open the Format menu. With the cells selected, look at the top menu bar. Click on Format to reveal the dropdown menu.
  4. Select Protect sheets and ranges. In the Format dropdown, scroll down to the bottom and click on Protect sheets and ranges. This opens the sidebar on the right side of the screen.
  5. Create a new rule. In the sidebar, you will see a list of existing protections. Click on the blue + New rule button at the top of the sidebar.
  6. Choose the scope. You will be asked to choose what to protect. For locking a row, select Selected cells. This allows you to precisely define which cells are affected by the protection.
  7. Define the range. Click on Set ranges. In the box that appears, you can select the exact cells again using your mouse, or you can type the range manually (for example, A1:E10). Ensure the permissions are set to View only (which effectively locks the data).
  8. Set the permissions. Below the range definition, you will see a section for Who can edit this sheet?. Select Only you from the dropdown menu. This ensures that you can continue to edit other parts of the sheet, but the specific cells you selected remain locked.
  9. Apply and confirm. Click Done in the sidebar. The protection is now active. You will notice that the row numbers are no longer clickable in the same way, and trying to edit a protected cell will display a warning or prevent the change.

Common Mistakes

Users often encounter issues because of how Google Sheets handles row locking versus sheet protection. One common mistake is trying to lock a row by simply clicking the lock icon in the toolbar. There is no direct "lock row" button. Without using the Protect sheets and ranges feature, the row can still be deleted or edited by anyone with permission.

Another frequent error is selecting the wrong scope. If you want to lock a single row but accidentally select the entire sheet, you will effectively make the whole document read-only. It is crucial to carefully verify the range selector before saving the rule.

Finally, users sometimes forget to change the permission setting. By default, when a new rule is created, it often sets permissions to "Anyone with the link" or a specific group. If you do not change this to Only you, the entire team you are sharing the sheet with will find that the row is locked, which is rarely the intended outcome.

Tips

When managing a shared spreadsheet, it is helpful to name your protection rules clearly. In the sidebar, you can edit the label of the rule (e.g., "Financial Data Row 5" or "Header Row") before clicking Done. This helps anyone looking at the sidebar later understand why a specific area is locked.

You can apply multiple protection rules to the same sheet. For example, you might protect the header row so it never gets moved, and protect the first column of data so it is never deleted. Google Sheets handles these rules independently, allowing you to have a mix of locked and unlocked areas within a single document.

For better usability, consider using conditional formatting in conjunction with protection. For instance, you could set a rule to highlight locked cells in a light yellow. This serves as a visual cue to other users that they should not edit that area.

Mobile App Instructions

Locking rows on a mobile device follows a similar logic but requires a different navigation path because the menus are condensed.

  1. Open the Sheet. Launch the Google Sheets app and tap on the document you want to edit.
  2. Tap the three dots. In the top right corner of the screen, tap the menu icon (three vertical dots).
  3. Select Protect sheets and ranges. Scroll down the menu and tap on Protect sheets and ranges.
  4. Create a new rule. Tap the + button in the top right corner of the protection list.
  5. Define the range. Tap Select cells. This will return you to the sheet view. Tap and drag to highlight the specific cells or rows you want to lock.
  6. Set permissions. Once the range is selected, tap the back arrow or Done. In the sidebar, tap on Who can edit this sheet? and change it to Only you.
  7. Save. Tap Done in the top right corner to save the rule.

Troubleshooting

If the rows are not locking as expected, follow these steps in order.

Check your access level. Ensure you are actually an Editor of the file. If you are a Viewer or Commentator, you cannot create or modify protection rules. If you created the rule as an Editor but were demoted to a Viewer later, the protection will remain in place, but you cannot change it.

Verify the range selection. Sometimes, the protection applies to a larger range than intended. Go back to Format > Protect sheets and ranges and check the list of rules. If a rule exists for the entire sheet or a large block of data, it might be overriding your specific row lock. You can edit the specific rule here to narrow down the range.

Check for conflicting permissions. If you are sharing the sheet with others, look at the Share settings. If you share the sheet with a specific group (e.g., "Finance Team") and set their permission to "Edit," they will be able to edit the sheet unless the protection rule specifically excludes them. The rule Only you is the most restrictive. If you want to allow others to edit but protect specific data, you must exclude that data range from the general edit permissions.

Clear cache and reload. If the interface seems unresponsive or the protection isn't applying visually, try refreshing the page. On a mobile device, closing the app completely and reopening it can force a sync of the protection rules.

Frequently Asked Questions

Does locking a row prevent it from being deleted?

Yes. When you protect a specific range of cells and set the permission to "Only you" (or a restricted user), you prevent anyone from modifying, deleting, or moving those cells. The row will remain exactly where it is.

Can I lock just one cell instead of a whole row?

Yes. The protection feature is granular. You can select a single cell, a column, or a non-contiguous set of cells. The steps remain the same; simply select the specific cell or cells you want to protect instead of highlighting an entire row.

What happens if I try to edit a locked cell?

If you are the owner of the sheet or have edit access, you can still edit locked cells. If you are a restricted user, attempting to edit a locked cell will either result in the change being rejected or a warning message indicating that the cell is protected.

Can I lock rows on a Mac or PC?

Yes. The method described above works for both Windows and macOS computers. The menu labels are identical, and the functionality is identical across all supported desktop operating systems.

Will the locked row be visible if I print the sheet?

Yes. Protection is for digital editing only. It does not affect how the document looks when printed or exported as a PDF. The locked row will appear on the printed page exactly as it does on the screen.

Can I lock rows in Google Sheets on an iPad?

Yes. The mobile app instructions provided earlier apply to iPads and other Android tablets. The interface is slightly different from a phone but offers the same protection capabilities.