disabling autofilter mode after filter data based on cell value

MKLAQ

Active Member
Joined
Jan 30, 2021
Messages
389
Office Version
  1. 2016
Platform
  1. Windows
hello
I have this code but I would make autofilter mode = false after filter data I tried with this code but it doesn't so far
any idea to do that ,please ?
VBA Code:
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Address = "$B$1" Then
 If Range("B2") = "All" Then

  Range("A3:E3").AutoFilter
 Else
  Range("A3:E3").AutoFilter Field:=2, Criteria1:=Range("B1")
  'ActiveSheet.AutoFilterMode = False
 End If
End If
 

Excel Facts

Will the fill handle fill 1, 2, 3?
Yes! Type 1 in a cell. Hold down Ctrl while you drag the fill handle.
What you are trying to do makes no sense. Why filter the table & then immediately remove the filter?
 
Upvote 0
May be my question is not clear what I want remove arrow relating autofilter
should autofiltemode =false after filter data but I no know where put it this
 
Upvote 0
Autofilter mode does not remove the dropdowns it removes the entire filter.
 
Upvote 0
I would remove arrows in topic headers from a3:e3 after filter data based on dropdown
 
Upvote 0
In that case try
VBA Code:
Private Sub Worksheet_Change(ByVal Target As Range)
Dim i As Long
If Target.Address = "$B$1" Then
 If Range("B2") = "All" Then

  Range("A3:E3").AutoFilter
 Else
   With Range("A3:e3")
   For i = 1 To 5
      If i = 2 Then
         .AutoFilter i, Range("B2").Value, , , 0
      Else
         .AutoFilter i, , , , 0
      End If
   Next i
   End With
 End If
End If
End Sub
 
Upvote 0
What do you mean it's gone?
 
Upvote 0
it hides the rows which contain data , it does not show any thing when select from dropdown
 
Upvote 0

Forum statistics

Threads
1,214,821
Messages
6,121,759
Members
449,048
Latest member
excelknuckles

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top