Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 131
Default Autofilter sorting.

Hiya

I have 6 columns with autofilter enabled.

I have been able to select autofilter via VBA as follows;
Selection.AutoFilter Field:=6, Criteria1:="TEB"
And all is fine

However I also want to sort column 1 in ascending order,
Selection.AutoFilter Field:=1 Order1:=xlAscending
But I can't get it right!

Can anyone in this forum help

With Thanks
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 131
Default Autofilter sorting.

would be easier to sort on demand,
I assume that it's not possible to sort in the same way as
Selection.AutoFilter Field:=6, Criteria1:="TEB" ?

Thanks anyway though

"Don Guillett" wrote:


Have you tried sorting first and then filtering.

--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"LaDdIe" wrote in message
...
Hiya

I have 6 columns with autofilter enabled.

I have been able to select autofilter via VBA as follows;
Selection.AutoFilter Field:=6, Criteria1:="TEB"
And all is fine

However I also want to sort column 1 in ascending order,
Selection.AutoFilter Field:=1 Order1:=xlAscending
But I can't get it right!

Can anyone in this forum help

With Thanks



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,480
Default Autofilter sorting.

Hi

Provided you have made your selection, then

Selection.Sort Key1:=Range("A1"), Order1:=xlAscending, Header:= _
xlGuess, Orientation:=xlTopToBottom

--
Regards
Roger Govier

"LaDdIe" wrote in message
...
Hiya

I have 6 columns with autofilter enabled.

I have been able to select autofilter via VBA as follows;
Selection.AutoFilter Field:=6, Criteria1:="TEB"
And all is fine

However I also want to sort column 1 in ascending order,
Selection.AutoFilter Field:=1 Order1:=xlAscending
But I can't get it right!

Can anyone in this forum help

With Thanks


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Enabling Autofilter and Sorting in a Protected Sheet [email protected] Excel Discussion (Misc queries) 2 January 3rd 12 07:14 PM
Autofilter-sorting from specified cell Mia Excel Programming 1 September 23rd 08 02:43 PM
Autofilter/Sorting Copying Wrong records Sandi Excel Discussion (Misc queries) 3 January 22nd 07 11:28 PM
Sorting after autofilter Dave Peterson Excel Programming 0 December 13th 06 12:30 AM
Sorting with AutoFilter m.cain Excel Discussion (Misc queries) 1 March 24th 06 01:56 PM


All times are GMT +1. The time now is 12:31 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"