View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
OssieMac OssieMac is offline
external usenet poster
 
Posts: 2,510
Default double click not working

Hi Joe,

Your code will always go into edit mode if the cell that is double clicked
is zero because you only cancel the edit mode if the cell is 0. However,
because you say that if you restart excel then it works correctly so I am
assuming that is not your problem. Therefore, perhaps you can share the code
in the called subs so it can be viewed and tested to see what is occurring.

I don't suppose that you have any Application.EnableEvents = False anywhere
in your code and it is exiting the sub before turning events back on because
that will cause your problem.

Also I wonder if there is a reason for inserting the parameters passed to
the called routines the way you have done. You can simply use Target. Plus I
personally think the code is easier to read if you use Select Case in lieu of
multiple If statements like the following example.

Private Sub Worksheet_BeforeDoubleClick(ByVal _
Target As Range, Cancel As Boolean)

If Target.Value 0 Then
Cancel = True
Else: Exit Sub
End If

Select Case Target.Column
Case 1
Call POtoContract(Target)
Case 4
Call CopyTableLine(Target)
End Select

End Sub

--
Regards,

OssieMac