Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
re-enabling the double click
if I evaluate a range of cells using the "beforeDoubleClick" event, I can
set the cancel argument to True, disabling the event. 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... how do I turn it back on? |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
re-enabling the double click
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 |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
re-enabling the double click
Mark
This is pretty kludgy, but here's what I came up with. In a standard module, put this Public bNewlyActive As Boolean Sub ResetNew() bNewlyActive = False End Sub In your sheet module, put this Private Sub Worksheet_BeforeDoubleClick( _ ByVal Target As Range, Cancel As Boolean) If bNewlyActive Then MsgBox "Dclicked an inactive cell" Else MsgBox "Dclicked an active cell" End If End Sub Private Sub Worksheet_SelectionChange(ByVal Target As Range) bNewlyActive = True Application.OnTime Now + TimeValue("00:00:01"), "ResetNew" End Sub -- Dick Kusleika MVP - Excel Excel Blog - Daily Dose of Excel www.dicks-blog.com "mark kubicki" wrote in message ... 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 |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
re-enabling the double click
kludgy is ok...
thanks a million... (i wasn't even certain that i was able to correctly communicate the dilemma) mark "Dick Kusleika" wrote in message ... Mark This is pretty kludgy, but here's what I came up with. In a standard module, put this Public bNewlyActive As Boolean Sub ResetNew() bNewlyActive = False End Sub In your sheet module, put this Private Sub Worksheet_BeforeDoubleClick( _ ByVal Target As Range, Cancel As Boolean) If bNewlyActive Then MsgBox "Dclicked an inactive cell" Else MsgBox "Dclicked an active cell" End If End Sub Private Sub Worksheet_SelectionChange(ByVal Target As Range) bNewlyActive = True Application.OnTime Now + TimeValue("00:00:01"), "ResetNew" End Sub -- Dick Kusleika MVP - Excel Excel Blog - Daily Dose of Excel www.dicks-blog.com "mark kubicki" wrote in message ... 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 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
How to change syperlink from single click to double click | Excel Worksheet Functions | |||
double click | Excel Discussion (Misc queries) | |||
Double click | Excel Discussion (Misc queries) | |||
Click on graph bar to execute a double-click in a pivot table cell | Charts and Charting in Excel | |||
Before Double-Click | Excel Discussion (Misc queries) |