VBA Code:
Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean)
Dim rngCol As Range
Dim Nextnum As Long
Set rngCol = Me.Columns("A:A")
If Not Intersect(rngCol, Target) Is Nothing Then
Cancel = True
Select Case Target.Value
Case Is <> "": Target.ClearContents
Case Else
Nextnum = WorksheetFunction.Max(rngCol) + 1
Target.Value = Nextnum
End Select
End If
If Not Intersect(Target, Range("C2")) Is Nothing Then
Cancel = True
ActiveSheet.Unprotect Password:="password"
ActiveSheet.Range("$A$3:$Q$603").AutoFilter Field:=3, Criteria1:="OFF"
ActiveSheet.Protect Password:="password", AllowFiltering:=True
End If
End Sub
using the above code im able to double click C2 and it Filters the Field with "OFF." I want to add the function to reset ("Select All") in the column filter when double click again.
Thanks