Sub BeforeDoubleClick(ByVal Sh As Object, ByVal Target As Range, Cancel As Boolean)
If Intersect(ActiveCell, Target) Is Nothing Then Exit Sub
If IsEmpty(Target) Then
Target = "X"
ActiveCell.Interior.ColorIndex = 34
Cancel = True
Else
If Target = "X" Then
Target = ""
ActiveCell.Interior.ColorIndex = xlColorIndexNone
Cancel = True
End If
End If
End Sub