Hello,

I wrote this code to make it easier to organize rows in the active sheet. So with one double click the current row is cut-selected and with another double click the row will be inserted. I used Range("B1") value to differentiate between the first double click and the second double click. But the problem is when you hit Esc to cancel the selection (i.e. the first double click) the second double click is always carried out because the value of B1 is the same.
How can I differentiate between the 1st and 2nd double clicks without having to set B1 value?

[vba]Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean)

Dim RwNum As Long
Dim DbCk As Integer

DbCk = Range("B1").Value

If ActiveCell.Value = "Not This Cell" Or ActiveCell.Row = 1 Then
Exit Sub
End If

Select Case DbCk

Case Is = 0
RwNum = ActiveCell.Row
Rows(RwNum).Select
Selection.Cut
Range("B1").Value = 1

Case Is = 1
Selection.Insert Shift:=xlDown
Range("B1").Value = 0

End Select

End Sub[/vba]