Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 89
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 535
Default 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   Report Post  
Posted to microsoft.public.excel.programming
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



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 599
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 89
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to change syperlink from single click to double click syperlinker Excel Worksheet Functions 0 June 13th 08 05:01 PM
double click lmb Excel Discussion (Misc queries) 4 September 6th 07 07:38 PM
Double click Anette Denmark Excel Discussion (Misc queries) 10 February 18th 07 04:24 PM
Click on graph bar to execute a double-click in a pivot table cell [email protected] Charts and Charting in Excel 4 August 3rd 05 01:37 AM
Before Double-Click Jim May Excel Discussion (Misc queries) 2 December 18th 04 05:52 PM


All times are GMT +1. The time now is 09:10 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"