# How to autofilter data range only in Calc?

I'm trying to sort a part of a table using auto filters but I can't figure out how to do it. I start with a table like this:

If I define a data range and then select and sort it by PRICE ascending, for example, it works fine:

(The data range used to sort the table is highlighted)

But if I enable autofilters on the very same data range and then click on the arrow at PRICE and choose "sort ascending" look at what happens:

Not only did it sort rows not included in the data range (these got messed up because they are sums of the cells above and after the sorting they didn't have the same number of rows above), but it added them to data range as can bee seen in the highlighted part and if I were to sort them again without autofilters I'd have to modify/redefine the datarange.

My question is how to use Auto filters on a data range without having these kind of problems. E.g. it should sort the selected rows and not modify the range to include everything below the headers before sorting the data.

Thanks

Version: 4.2.8.2 - Build ID: 420m0(Build:2) - OS: Ubuntu 14.04.3 LTS 64-bit

PD: Sorry if the links to the screenshots appear twice but at first it didn't look like the "image" format would work so I put the links in text to make sure

edit retag close merge delete

Sort by » oldest newest most voted

Hi

I reproduce the problem (on windows 7/64 & 5.0.3.1).

Sort by auto-filter should apply by default to the data range (if it is defined) and, at the very least, it should respect the selected range (instead of extending to the contiguous range).

May be you can fill a report Issue (help here)?

Meanwhile, the workaround is to use DataSortthat applies (default) to the data range defined by DataDefine Range

Regards

more