Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 87
Default Turn Filters On and Off

The below code successfully adds AutoFilters to the selection. How do I
remove the AutoFilters? Tried recording a macro but the code is the same as
for adding filters.

Private Sub CommandButton4_Click()
'Command Button: "Add Filters"
Application.ScreenUpdating = False
Range("B3:I3").Select
Selection.AutoFilter
Application.ScreenUpdating = True
End Sub
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,316
Default Turn Filters On and Off

The same line that turn AutoFilter on is the same command that will turn them
off:

Selection.AutoFilter

--
Kevin Backmann


"Phil H" wrote:

The below code successfully adds AutoFilters to the selection. How do I
remove the AutoFilters? Tried recording a macro but the code is the same as
for adding filters.

Private Sub CommandButton4_Click()
'Command Button: "Add Filters"
Application.ScreenUpdating = False
Range("B3:I3").Select
Selection.AutoFilter
Application.ScreenUpdating = True
End Sub

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default Turn Filters On and Off

You can also use

Activesheet.Autofiltermode = False

--
Regards,
Tom Ogilvy


"Phil H" wrote:

The below code successfully adds AutoFilters to the selection. How do I
remove the AutoFilters? Tried recording a macro but the code is the same as
for adding filters.

Private Sub CommandButton4_Click()
'Command Button: "Add Filters"
Application.ScreenUpdating = False
Range("B3:I3").Select
Selection.AutoFilter
Application.ScreenUpdating = True
End Sub

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
Turn filters on in multiple sheets EstherJ Excel Programming 6 September 29th 08 12:57 PM
Pivot Table filters, especially DATE filters chris Excel Worksheet Functions 0 August 27th 08 04:33 AM
Filters, Subtotal & Intacted Results after the filters' Removal kasiopi Excel Discussion (Misc queries) 5 February 24th 06 12:18 PM
Turn ON Autofilter Filters dcHill Excel Programming 1 June 16th 05 07:53 PM
Code to automatically turn on and turn off Track Changes John[_46_] Excel Programming 1 October 7th 03 02:22 AM


All times are GMT +1. The time now is 03:01 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"