Prevent Calc from sorting column labels with data using AutoFilter?

I have a minimal file that exhibits the behavior for me.

Instructions:

  1. Select “Sort Ascending” from the “Start” column pulldown
  2. Observe that the column headers, and pulldown controls, get sorted with the data.

Version 4.0.0.3.

Screenshot:

Test file

Screenshot

In My case the problem was that the top row contained some labels with numbers and % sign (actually cell’s format was Percent)
I had to name that cell with the word (along with numbers, cause I need it so), and everything works fine. When sorting ranges, the Labels stays up top.

Make sure that all the headings are filled in. Blank headings do cause this problem for me.

+1
I have been pulling my hair out over this as well. A bit of tinkering suggests that headings must contain non-empty text. E.g a numeric entry that just happens to look OK isn’t good enough. It has to be '-prefixed to make it text.

I wanted to upvote this, but I have no rep.

I was having this same problem today. I was working on data imported from html in one worksheet, and on data exported to xlsx in a second worksheet. The former would sort the headers with the data, the latter did not.

As it turns out, when Calc imports data from html, it does strange stuff with columns - for example, a column of data would show as being in both column C and column D. Once I got rid of the phantom columns and deleted any remaining columns with no data in them, the column headers stopped being sorted.

You could try to import html tables trough Menu/Insert/Link to external data, after enter the url wait a bit, then you can select the table to import.