SciTeacherEd
New member
- Joined
- Feb 27, 2013
- Messages
- 3
- Reaction score
- 0
- Points
- 0
If I understand it correctly, the Cancel parameter is supposed to prevent the Worksheet_BeforeDoubleClick action from exiting to edit mode. The problem is, I have included Cancel = True, but it still leaves me in edit mode.
I am using Excel 2010.
Any suggestions, or workarounds?
here is the code:
It wouldn't really be a problem, except that I am cycling through 0, 1, -1, and with -1 I have to hit escape befor clicking another cell or it asumes I am entering a formula.
Thanks,
Ed
I am using Excel 2010.
Any suggestions, or workarounds?
here is the code:
Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean)
Dim myRange As Range
Dim strMarker As String
Set myRange = Range("1:3")
If Target.Cells.Count > 1 Then Exit Sub
If Not Intersect(Target, myRange) Is Nothing Then
If Target.Value = 0 Then
Target.Value = 1
Else
If Target.Value = 1 Then
Target.Value = -1
Else
If Target.Value = -1 Then Target.Value = 0
End If
End If
End If
Cancel = True
End Sub
It wouldn't really be a problem, except that I am cycling through 0, 1, -1, and with -1 I have to hit escape befor clicking another cell or it asumes I am entering a formula.
Thanks,
Ed