Sort data whilst autofiler is on

B

bony_tony

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
 
J

Jim Rech

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
| 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
|
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top