• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Filter-macro

sdsurzh

Member
Hi,


I want a code if the active sheet as filter then it should msg "Filter available" otherwise it should apply filter.


Thanks,

Suresh Kumar S
 
In the ThisWorkbook module, paste this in

[pre]
Code:
Private Sub Workbook_SheetActivate(ByVal Sh As Object)
If Sh.AutoFilterMode Then
MsgBox "Filter available"
Else
Sh.UsedRange.AutoFilter
End If
End Sub
[/pre]
 
Back
Top