View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
goodfish goodfish is offline
external usenet poster
 
Posts: 20
Default doubleclick event only works once

Hello!
I posted this question a week ago but I never received the confirmation
email and I can't find it when I search the community.
Basically I have a problem with a doubleclick event.
I run the following macro (by doubleclicking) to call one of two macros.
Private Sub Worksheet_BeforeDoubleClick(ByVal _
Target As Range, Cancel As Boolean)
Dim dcCell As Range

If Target.Value 0 Then

If Target.Column = 1 Then

Call POtoContract(dcCell:=Target)
Cancel = True
Else
If Target.Column = 4 Then
Cancel = True
Call copytableline(cyCell:=Target)

End If
End If
End If
End Sub

If macro POtoContract is called then the user is prompted to enter the a
name and if he enters a wrong name then the sub exits (which is what it
should do). However, trying to doubleclick again to call the macro a second
time now enters editing mode instead of calling the macro again. Why?
If On the other hand the user does not enter a wrong name then POtoContract
runs till the end and double clicking still works after that.