Lock header rows when sorting

Discuss the spreadsheet application
Post Reply
palm3ro
Posts: 5
Joined: Wed Apr 22, 2009 1:01 pm

Lock header rows when sorting

Post 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.
Last edited by Villeroy on Wed Apr 22, 2009 8:30 pm, edited 1 time in total.
Reason: edited title
OOo 2.2.X on Ms Windows XP
User avatar
Hagar Delest
Moderator
Posts: 32627
Joined: Sun Oct 07, 2007 9:07 pm
Location: France

Re: Lock rows

Post 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.
LibreOffice 7.6.2.1 on Xubuntu 23.10 and 7.6.4.1 portable on Windows 10
palm3ro
Posts: 5
Joined: Wed Apr 22, 2009 1:01 pm

Re: Lock rows

Post 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...
OOo 2.2.X on Ms Windows XP
User avatar
TheGurkha
Volunteer
Posts: 6482
Joined: Thu Mar 13, 2008 12:13 pm
Location: North Wales, UK.

Re: Lock rows

Post 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.
Ubuntu 14.10 Utopic Unicorn, LibreOffice Version: 4.3.3.2
Gurkha Welfare Trust
User avatar
Villeroy
Volunteer
Posts: 31269
Joined: Mon Oct 08, 2007 1:35 am
Location: Germany

Re: Lock rows

Post 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.
Please, edit this topic's initial post and add "[Solved]" to the subject line if your problem has been solved.
Ubuntu 18.04 with LibreOffice 6.0, latest OpenOffice and LibreOffice
palm3ro
Posts: 5
Joined: Wed Apr 22, 2009 1:01 pm

Re: Lock header rows when sorting

Post 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?
OOo 2.2.X on Ms Windows XP
User avatar
Villeroy
Volunteer
Posts: 31269
Joined: Mon Oct 08, 2007 1:35 am
Location: Germany

Re: Lock header rows when sorting

Post 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.
Please, edit this topic's initial post and add "[Solved]" to the subject line if your problem has been solved.
Ubuntu 18.04 with LibreOffice 6.0, latest OpenOffice and LibreOffice
palm3ro
Posts: 5
Joined: Wed Apr 22, 2009 1:01 pm

Re: Lock header rows when sorting

Post by palm3ro »

If i want to sort by phonenumber, zipcode or whatever, without to define sortorder in menu data sort, is that possible?
OOo 2.2.X on Ms Windows XP
User avatar
Villeroy
Volunteer
Posts: 31269
Joined: Mon Oct 08, 2007 1:35 am
Location: Germany

Re: Lock header rows when sorting

Post 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.
Please, edit this topic's initial post and add "[Solved]" to the subject line if your problem has been solved.
Ubuntu 18.04 with LibreOffice 6.0, latest OpenOffice and LibreOffice
palm3ro
Posts: 5
Joined: Wed Apr 22, 2009 1:01 pm

Re: Lock header rows when sorting

Post by palm3ro »

I tried that and it still sorts by name not the cell i mark within a column.
OOo 2.2.X on Ms Windows XP
User avatar
Villeroy
Volunteer
Posts: 31269
Joined: Mon Oct 08, 2007 1:35 am
Location: Germany

Re: Lock header rows when sorting

Post 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
Please, edit this topic's initial post and add "[Solved]" to the subject line if your problem has been solved.
Ubuntu 18.04 with LibreOffice 6.0, latest OpenOffice and LibreOffice
Post Reply