Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default remove autofilter results with a macro

I can't seem to find anything similar to this. I'm trying to setup a macro
that will unfilter the sheet if the autofilter has been engaged. I can get
it to work as long as at least 1 column has been autofiltered, but if none
has been I get a run time error 1004. So then I tired a If then, but it
keeps hanging on part of the field. Thanks for your help.
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default remove autofilter results with a macro

With worksheets("Input")
'to remove the filter and the arrows
.AutoFilterMode = False

'or to just show all the data and keep the arrows
If .FilterMode Then
.ShowAllData
End If
End With


You could have ignored the error, too:

on error resume next
ActiveSheet.ShowAllData 'keeps the arrows, shows all the data.
on error goto 0

Muth69 wrote:

I can't seem to find anything similar to this. I'm trying to setup a macro
that will unfilter the sheet if the autofilter has been engaged. I can get
it to work as long as at least 1 column has been autofiltered, but if none
has been I get a run time error 1004. So then I tired a If then, but it
keeps hanging on part of the field. Thanks for your help.


--

Dave Peterson
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
Autofilter results Ben Wunderin Excel Discussion (Misc queries) 3 December 2nd 08 12:31 AM
at excel start need macro to remove autofilter & apply sort mult t Nullentropy Excel Programming 1 September 19th 08 02:29 AM
Using autofilter results Cleber Inacio Excel Programming 1 November 18th 07 07:11 PM
Copy Autofilter results macro CLR Excel Programming 7 May 16th 05 06:48 PM
Strange Results with Autofilter Joyce Excel Discussion (Misc queries) 1 January 17th 05 02:42 AM


All times are GMT +1. The time now is 06:38 PM.

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"