Calc - how to make calc remember that first row is title row when sorting

LO 6.4 on linux mint 19.3 mate
My data are in columns A and B and the first row is the title row. I’ve also applied an autofilter. Every time I add data, I have to sort the columns. And every time again I have to tell Calc that the first row is the title row (select the option “range contains column labels” in the sort-dialog) because Calc always resets that option to “disabled”. How can I make Calc remember that the first row is the title row?

Column A has a title?
Column A and B use numbers as title?
If do you want a good answer, edit your question and add a reduced sample file. Thanks.

Just FYI, in general, without any torture testing, LO 7.3 retains this option for me between sorts.

As a Linux user, you might have so coding skills…so you could take a glance at Macro Sort only allows 3 criteria - #9 by EquipLordBritish and browse both of the answers. I realize that some people want to avoid macros at all costs since they share the spreadsheets, others may find macros a great way to personalize projects they almost exclusively use themselves.

Hi, thanks for replying. I did make a macro to sort the columns, so that takes care of the immediate problem. It still doesn’t explain why the option disables between sorts, but at least I can get some work done. Thanks for the link!

Share a sample to test.

I needed some more experimenting before I could reproduce the problem. I’ve included a sample file. As far as I understand now, the problem was due to some columns in the sort range not having a column title AND not being included in the autofilter.

If all columns have a label, or if all columns are included in the autofilter, or if there is no autofilter, then the issue does not occur.

calc-sortproblem-forum.ods (21.9 KB)

Thanks for sharing a sample file.

Range contains column labels will be marked (regardless of whether AutoFilter is enabled), if each column have a title that is text (no number or date). Otherwise you must mark it each time do you need to make a new sort.
Tested with LibreOffice on Linux 5.3.

After some more test, it appears that if there are at least one label in row 1 Range contains column labels will be marked. But if labels are not in row 1, all columns must be text labels.

You can define your table as a data range. Then it will default to use headings.

  • Select columns A:I
    Type A:I into the address field, or click grid coordinate letters to select the entire columns.
  • Select menu item Data - Define range
  • Type a range name for your table.
  • Click to expand the Options/More section, and make sure column labels is selected.
  • Click button to add data range
  • OK

The selection to sort with headings will now be persistent, and empty rows will not be included in the sort.

Note: All rows down the grid will be part of the data range, so you can’t use parts of the sheet below your data for other content. If you select only current rows, added data will not be part of the data range. If you know a certain “hard limit” to rows, it is possible to select the “max range” instead of the entire height of the grid.

1 Like

Hi, thanks for replying! I’ve actually never used Data Ranges, so thanks for expanding my world!