ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Sort data whilst autofiler is on (https://www.excelbanter.com/excel-programming/386741-sort-data-whilst-autofiler.html)

bony_tony

Sort data whilst autofiler is on
 
Hi,
I would like to sort all of my data whilst the autofiler is on. I
currently have to clear the autofilter to select all the data, as...

Range("A5:P" & Cells(Rows.Count, "A").End(xlUp).Row).Select
Selection.Sort Key1:=Range("C6"), Order1:=xlAscending,
Header:=xlGuess, _
OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom

will only go down to the last row the autofilter is displaying. (ie.
say if row 10 is the last row in my table, and is filtered out, the
selection will only go down to row 9)

Any ideas how to select all of my table whilst the autofiler is on??

Thanks


Jim Rech

Sort data whilst autofiler is on
 
It does not matter whether you select the entire table or not. With an
autofilter on Excel will sort only the visible rows. You will have to
remove the filter, sort and re-apply the filter.

--
Jim
"bony_tony" wrote in message
oups.com...
| Hi,
| I would like to sort all of my data whilst the autofiler is on. I
| currently have to clear the autofilter to select all the data, as...
|
| Range("A5:P" & Cells(Rows.Count, "A").End(xlUp).Row).Select
| Selection.Sort Key1:=Range("C6"), Order1:=xlAscending,
| Header:=xlGuess, _
| OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom
|
| will only go down to the last row the autofilter is displaying. (ie.
| say if row 10 is the last row in my table, and is filtered out, the
| selection will only go down to row 9)
|
| Any ideas how to select all of my table whilst the autofiler is on??
|
| Thanks
|




All times are GMT +1. The time now is 10:33 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com