# Spreadsheets: Locking Rows

**URL:** <https://boards.straightdope.com/t/spreadsheets-locking-rows/537805>\
**Category:** Factual Questions\
**Created:** [April 29, 2010, 11:45pm UTC](https://boards.straightdope.com/t/spreadsheets-locking-rows/537805 "2010-04-29T23:45:28Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Taenia\_spp](https://avatars.discourse-cdn.com/v4/letter/t/b5e925/32.png) [@Taenia\_spp](https://boards.straightdope.com/u/Taenia_spp)\
**Post date:** [April 29, 2010, 11:45pm UTC](https://boards.straightdope.com/t/spreadsheets-locking-rows/537805/1 "2010-04-29T23:45:28Z")

</div>

I’m currently using the latest version of [OpenOffice.org](http://OpenOffice.org) Calc, but I believe this should be generalizable to Excel. What I want to do is lock a row of cells together, so that when I sort one column, it won’t just move the elements in one column around and leave all the other associated information in the other columns untouched. I’ve tried looking under the help topics, but nothing really seems to be what I want. Any help?

---

<div class="post-metadata">

**Author:** ![yoyodyne](https://avatars.discourse-cdn.com/v4/letter/y/a9a28c/32.png) [@yoyodyne](https://boards.straightdope.com/u/yoyodyne)\
**Post date:** [April 30, 2010, 12:35am UTC](https://boards.straightdope.com/t/spreadsheets-locking-rows/537805/2 "2010-04-30T00:35:33Z")

</div>

Select all of the cells with data in them. Go to Data, Sort to select which columns to sort by.

---

<div class="post-metadata">

**Author:** ![K364](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/k364/32/5_2.png) [@K364](https://boards.straightdope.com/u/K364)\
**Post date:** [April 30, 2010, 4:05am UTC](https://boards.straightdope.com/t/spreadsheets-locking-rows/537805/3 "2010-04-30T04:05:50Z")

</div>

Can’t comment on Open Office, but for Excel:

It is best to have your data arranged as a proper “list”… this is a rectangle with no blank rows or columns (the occasionally blank cell is ok). And the first row is a header, and it is formatted to stand out. Excel sees all this and says to itself “aha, a list! I won’t mix these rows up when I sort them”.

If you select one cell in the list and click on the sort, Excel doesn’t even ask you what you’re intentions are, it just sorts the list based upon the column the selected cell is in. If you select more than one cell in the list, but not all the columns, Excel will pop up a dialog box asking you if you want to include the adjacent columns.

If you have data not in a list, it will probably just sort the selected cells.
