Euro5
asked on
vba autofilter in row 4
I need to remove a filter that is applied to a table.
The problem is, the filter is in row 4, not row 1.
When I try to use
I have also tried:
Any ideas?
The problem is, the filter is in row 4, not row 1.
When I try to use
Selection.AutoFilter
or variation, it just applies the filter to row 1.I have also tried:
If ActiveSheet.AutoFilterMode Then Cells.AutoFilter
Any ideas?
Hi,
Please try below, change Column C for Last Row and change the range for rngFilter
Please try below, change Column C for Last Row and change the range for rngFilter
Sub ResetFilter()
Dim Ws As Worksheet
Dim LR As Long
Dim RngFilter As Range
Set Ws = ActiveSheet
Ws.Cells.AutoFilter
LR = Ws.Range("C" & Rows.Count).End(xlUp).Row
Set RngFilter = Ws.Range("C4:L" & LR)
RngFilter.AutoFilter Field:=3, Criteria1:="<>""", Operator:=xlOr
End Sub
did you try
ActiveSheet.ShowAllData
ActiveSheet.ShowAllData
ASKER
Neeraj,
Didn't work. It removes the filter if it is in row 1, but the filter is still on the table.
I tried to recording a macro, but that didn't work either. Not sure what I'm missing...
Didn't work. It removes the filter if it is in row 1, but the filter is still on the table.
I tried to recording a macro, but that didn't work either. Not sure what I'm missing...
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Do you want to remove the filter from the sheet?
If so, you may try this.....
If so, you may try this.....
ActiveSheet.AutoFilterMode = False
Open in new window