I have data on sheet2 and have written code to clear filter if on, but the code does not do this
It would be appreciated if some would test my code and amend
It would be appreciated if some would test my code and amend
Code:
Sub Clear_Data()
With Sheets(2)
Dim LR As Long
LR = .Cells(.Rows.Count, "A").End(xlUp).Row
Sheets(2).Select
If ActiveSheet.FilterMode Then
Cells.autofilter
End If
.Range("A2:AZ" & LR).ClearContents
End With
End Sub