VBA Code:
Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean)
Dim resp As VbMsgBoxResult
If Not Intersect(Target, Columns("B")) Is Nothing Then
Cancel = True
resp = MsgBox(Prompt:="THIS WILL REMOVE EMPLOYEE FROM THE ROSTER. DO YOU WISH TO CONTINUE?", Buttons:=vbYesNoCancel)
If resp = vbYes Then
Range(Replace("B#:D#,F#,H#:EB#", "#", Target.Row)).ClearContents
Intersect(Target.Offset(1).EntireRow, Range("AG:EB")).ClearContents
ActiveWorkbook.Worksheets("DATS").AutoFilter.Sort.SortFields.Clear
ActiveWorkbook.Worksheets("DATS").AutoFilter.Sort.SortFields.Add Key _
:=Range("A1:A1000"), SortOn:=xlSortOnValues, Order:=xlAscending, _
DataOption:=xlSortNormal
With ActiveWorkbook.Worksheets("DATS").AutoFilter.Sort
.Header = xlYes
.MatchCase = False
.Orientation = xlTopToBottom
.SortMethod = xlPinYin
.Apply
End With
End If
End If
If Not Intersect(Target, Range("D1")) Is Nothing Then
Application.EnableEvents = False
ActiveWorkbook.Worksheets("DATS").AutoFilter.Sort.SortFields.Clear
ActiveWorkbook.Worksheets("DATS").AutoFilter.Sort.SortFields.Add Key:=Range( _
"A1"), SortOn:=xlSortOnValues, Order:=xlAscending, DataOption:= _
xlSortNormal
With ActiveWorkbook.Worksheets("DATS").AutoFilter.Sort
.Header = xlYes
.MatchCase = False
.Orientation = xlTopToBottom
.SortMethod = xlPinYin
.Apply
End With
End If
End Sub
using the above double click I find that when I use one of the double click on D1 it works however it seems to disable the first set of double click option when i click on B column it does not active at. At times i have to save close and then try double click the B column for it to work.
Any idea why this is happening