View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
Mark Kubicki Mark Kubicki is offline
external usenet poster
 
Posts: 89
Default re-enabling the double click

not quite...i understand that part,

the conflict is that in A1:B2, i only want to disable the double click to a
currently (before the dbl clickevent)
inactive cell
but,
if the cell is already active -thru a "click" event (not a "double click"),
the "double click event" needs to be enabled for the user to initiate
in-cell editing (without using the F2 option) (however, the double click has
previously been disabled


can i do something like:
beforeDoubleClick
if intersect, and cell has not been active
or
restore DoubleClick argument for cancel to false for all the cells?


"Jan Karel Pieterse" wrote in message
...
Hi Mark,

problem is that I don't always want that condition; for example, so that

the
user can perform in-cell editing with cells in that same range, they

should
be able to DoubleClick within the active cell (selected/activated by a
single Click) with would start the editing. ...However, the cancel

argument
of the double click disabled that possibility...


By telling VBA when to cancel and when not:

Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As
Boolean)
If Intersect(Me.Range("A1:B2"), Target) Is Nothing Then
MsgBox "Editing allowed"
Else
MsgBox "Editing blocked in A1:B2"
Cancel = True
End If
End Sub

Regards,

Jan Karel Pieterse
Excel MVP
www.jkp-ads.com