PDA

View Full Version : Macro to un-filter data



Emma
10-10-2008, 02:05 PM
Hi guys, i need some help in writing a macro. Basically what i am after is a workbook macro that will un-filter data when i click away from Sheet "Swaps". So say if i click on Sheet "Options" or sheet "Futures", that data in sheet "Swaps" will show all but still keep autofilter.

Bob Phillips
10-10-2008, 03:47 PM
Private Sub Worksheet_Deactivate()
Me.Cells.AutoFilter
End Sub


This is worksheet event code, which means that it needs to be
placed in the appropriate worksheet code module, not a standard
code module. To do this, right-click on the sheet tab, select
the View Code option from the menu, and paste the code in.