Put this in your worksheet area of the code:
Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean)
If UCase(Target) = "CLEAR" Then Range("E4:E" & Cells(Rows.Count, 1).End(xlUp).Row) = ChrW(9744): Cells.EntireRow.Hidden = False: Cancel = True: Exit Sub
If Target = ChrW(9744) Then Target = ChrW(9745): Cancel = True: Exit Sub
If Target = ChrW(9745) Then Target = ChrW(9744): Cancel = True: Exit Sub
Dim cell As Range
If UCase(Target) = "FILTER" Then
Application.ScreenUpdating = False
For Each cell In Range("E2:E" & Cells(Rows.Count, 1).End(xlUp).Row)
If cell <> ChrW(9745) Then cell.EntireRow.Hidden = True
Next cell
Target = "Unfilter"
Cancel = True
Application.ScreenUpdating = True
Exit Sub
End If
If UCase(Target) = "UNFILTER" Then Cells.EntireRow.Hidden = False: Target = "Filter": Cancel = True
End Sub
Write in any cell in row 1 (for example in D1) the word "Clear" and double click it.
In column E, a bunch of 'checkboxes' will appear - double click them to toggle them.
Write in any cell in row 1 (for example in E1) the word "Filter" and double click it.
Only the 'checked' boxes will remain and the word 'Filter' changes to 'Unfilter'. Guess what that does :-)
Enjoy.
Bookmarks