Cannot apply AutoFilter to columns implicitly; only explicit cell ranges are accepted
*Created originally on Bitbucket by [kamakazikamikaze (Kent Coble)](https://bitbucket.org/%7B222c08ca-6aa7-4e76-a03e-bbf5b14c388c%7D/)*
Hi there! I think we've found a bug with [filters and sorts.](https://openpyxl.readthedocs.io/en/default/filters.html) In release version 2.3.5, we were able to apply a filter and sort to a column (range) with the following:
```python
ws.auto_filter.ref = 'A:B'
ws.auto_filter.add_filter_column(1, ['Inactive'])
ws.auto_filter.add_sort_condition('A')
```
We upgraded to 2.4.2 for good measure after hearing about the potential XXE vulnerability. Since then, we cannot apply filters to a whole column anymore (we've tested only 2.4.2 and 2.4.4). When we try to run the first or third lines from the code above, the following error is raised:
```
File "stalePortReport.py", line 488, in write
ws.auto_filter.ref = 'A:B'
File "/usr/local/lib/python2.7/dist-packages/openpyxl/descriptors/excel.py", line 94, in __set__
super(CellRange, self).__set__(instance, value)
File "/usr/local/lib/python2.7/dist-packages/openpyxl/descriptors/base.py", line 255, in __set__
raise ValueError('Value does not match pattern {0}'.format(self.pattern))
ValueError: Value does not match pattern ^[$]?(?P<min_col>[A-Za-z]{1,3})[$]?(?P<min_row>\d+)(:[$]?(?P<max_col>[A-Za-z]{1,3})[$]?(?P<max_row>\d+)?)?$
```
To get around this, we must _explicitly_ specify the cells, such as the following:
```python
ws.auto_filter.ref = 'A1:B145'
ws.auto_filter.add_filter_column(1, ['Inactive'])
ws.auto_filter.add_sort_condition('A2:A145')
```
I'm not sure if _our_ way of using it was actually a bug and got patched or if this was accidentally removed (change to Regex pattern?). All I could find was a note in the 2.4.0-a1 release about `Convert AutoFilter to Serialisable and extend support for filters`.
I've attached a workbook, should you not be able to replicate this in your own files. It's the second spreadsheet ('Building1') that we're trying to apply the filter to.
*Attachments:* [debug.xlsx](/uploads/2e7843e1139439feee7faabbac0e35d6/debug.xlsx)
issue