Page 1 of 1

Lock header rows when sorting

Posted: Wed Apr 22, 2009 1:08 pm
by palm3ro
I have several rows with name and surname in two columns, and more information after that in more columns, now i would like to lock the rows so i can sort by name, surname and what ever, is that possible? I also would like to know if it are any easy way to sort by name surname or any other info that i choose.

Re: Lock rows

Posted: Wed Apr 22, 2009 2:05 pm
by Hagar Delest
Do you mean freeze the window like that one: [Solved] Keeping the first Column visible as a label?

Thanks to add '[Solved]' at beginning of your first post title (edit button) if your issue has been fixed.

Re: Lock rows

Posted: Wed Apr 22, 2009 5:44 pm
by palm3ro
No thats not what i meant, what i mean are. Example, i have columns: name, surname, address, phonenumber, emailaddress and some more columns, if i sort the rows now so do i have to choose column to sort from, if i sort from column A the other columns doesnt show the right surname it only sort after column A and i want the whole row to be sorted. I want all cells in a row to be as one then i sort...

Re: Lock rows

Posted: Wed Apr 22, 2009 7:33 pm
by TheGurkha
Click in the column you want to sort by, but don't highlight the column. Then sort. I just tried it and all rows in all columns moved accordingly, not just the column I decide to sort by.

Re: Lock rows

Posted: Wed Apr 22, 2009 8:03 pm
by Villeroy
Having such a database-like list, it is recommended to select the entire list (incl. column labels) and give a name to it: Call menu:Data>Define... <descriptive_name> [Add], [OK].
menu:Data>Sort... lets you choose up to 3 columns, for instance first order by surname, equal surnames by forname, equal names by zip-code. Take notice of the additional options on the second tab of the sort dialogue.
Now this sort order is stored for the named database range. After editing the range you can call menu:Data>Refresh in order to apply the same sort order again.
When adding new rows to the list, always insert new rows rather than appending them into the blank space below. This way the named reference expands to the new size as well as all other references, for instance SUM(A2:A99) becomes SUM(A2:A100) when you insert row.
Likewise you delete rows in order to shrink the list.
TheGurkha wrote:Click in the column you want to sort by, but don't highlight the column. Then sort. I just tried it and all rows in all columns moved accordingly, not just the column I decide to sort by.
This detects the currently used region and sorts all rows including a first row of column labels and possibly a trailing row of calculated results (sum of column).
The quick-sort method by button works well if you keep a blank, hidden row below the column labels and then click a single cell in the data range.

Re: Lock header rows when sorting

Posted: Wed Apr 22, 2009 8:48 pm
by palm3ro
now i have solved it, but a new problems appeared, if i sort by ascending or descending from the standard menubar it also sort by the label and place the label within the database and not on the top of the database, how to solve that?

Re: Lock header rows when sorting

Posted: Wed Apr 22, 2009 8:54 pm
by Villeroy
Read the second part of my last answer. Use blank, hidden rows to separate the data range from column labels and other stuff.

Re: Lock header rows when sorting

Posted: Wed Apr 22, 2009 9:19 pm
by palm3ro
If i want to sort by phonenumber, zipcode or whatever, without to define sortorder in menu data sort, is that possible?

Re: Lock header rows when sorting

Posted: Wed Apr 22, 2009 10:11 pm
by Villeroy
Yes, it's possible. Insert a blank row below the column labels and then hide the blank row, so your list is separated from the headers.
Click a single cell in the column you want to sort by. Do not highlight anything, just click any data-cell below the column header.
Click the sort button.

Re: Lock header rows when sorting

Posted: Wed Apr 22, 2009 10:21 pm
by palm3ro
I tried that and it still sorts by name not the cell i mark within a column.

Re: Lock header rows when sorting

Posted: Wed Apr 22, 2009 10:51 pm
by Villeroy
I just see that you are using a very old version which is the reason why it does not work as desired. Current version is 3.0.1. Version 3.1 will be released next week or so.

Sorting improvements

A - B - C - D - E - F - G. You would think there isn't much left to do with sorting, but OpenOffice.org 3.1 brings no less than four improvements to sorting cells in Calc. They are keeping cell notes with their contents, identifying the default column for the sort toolbar buttons, not sorting column headers, and stable sorting. In previous versions, the unstable sorting would yield random results in certain situations.
http://www.oooninja.com/2009/01/openoff ... tures.html