I have this code to remove duplicate but every time I run this macro, the auto filter on sheet 2 is removed. Sheet2 has a filter from B7:N7.

Here is the code:
Sub RemoveDups(rngDups As Range, Optional rngTarget As Range)
If rngTarget Is Nothing Then
rngDups.RemoveDuplicates Columns:=1, Header:=xlYes
Else
rngDups.AdvancedFilter Action:=xlFilterCopy, CopyToRange:=rngTarget, Unique:=True
End If
End Sub

Sub DEDUP()
Application.Calculation = xlCalculationAutomatic
Call RemoveDups(Sheet2.Range("S8:S15000"), Sheet11.Range("B2"))
End Sub

My problem is how to keep the auto filter on sheet2.

Thanks.