Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 691
Default Stop Cell Edit when DoubleClick

When I double-click on a cell it puts the cell into
"Edit mode". How do I turn this off. True whether
there is a double-click Event macro or not. My concern
is when a macro is involved, having the cell in Edit mode
messes up things including working in the VBE while
in cell edit.

Shows up more obviously if cell content is like
'AAA because then you will see the single quote
within the cell and the cursor after the last character.

Tools, Options, Edit, Edit Directly in a Cell
is invoked and it will stay that way.
Just want the macro to not leave it in Edit mode.

Test without and with a macro:
Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean)
MsgBox "do nothing"
End Sub

The following will circumvent, but there must be a better way

Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean)
MsgBox "do nothing"
Application.SendKeys "{Down}"
Application.SendKeys "{up}"
End Sub

And if "edit mode" is not the correct terminology
please correct. Might be obvious from the solution though.
---
TIA,
David McRitchie, Microsoft MVP - Excel [site changed Nov. 2001]
My Excel Pages: http://www.mvps.org/dmcritchie/excel/excel.htm
Search Page: http://www.mvps.org/dmcritchie/excel/search.htm



  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 79
Default Stop Cell Edit when DoubleClick

Tools/Options/Edit tab, uncheck Edit directly in cells

HTH, Greg

"David McRitchie" wrote in message
...
When I double-click on a cell it puts the cell into
"Edit mode". How do I turn this off. True whether
there is a double-click Event macro or not. My concern
is when a macro is involved, having the cell in Edit mode
messes up things including working in the VBE while
in cell edit.

Shows up more obviously if cell content is like
'AAA because then you will see the single quote
within the cell and the cursor after the last character.

Tools, Options, Edit, Edit Directly in a Cell
is invoked and it will stay that way.
Just want the macro to not leave it in Edit mode.

Test without and with a macro:
Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As

Boolean)
MsgBox "do nothing"
End Sub

The following will circumvent, but there must be a better way

Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As

Boolean)
MsgBox "do nothing"
Application.SendKeys "{Down}"
Application.SendKeys "{up}"
End Sub

And if "edit mode" is not the correct terminology
please correct. Might be obvious from the solution though.
---
TIA,
David McRitchie, Microsoft MVP - Excel [site changed Nov. 2001]
My Excel Pages: http://www.mvps.org/dmcritchie/excel/excel.htm
Search Page: http://www.mvps.org/dmcritchie/excel/search.htm





  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,302
Default Stop Cell Edit when DoubleClick

Hi David,

In the double-click Event macro set Cancel = True.

---
Regards,
Norman


"David McRitchie" wrote in message
...
When I double-click on a cell it puts the cell into
"Edit mode". How do I turn this off. True whether
there is a double-click Event macro or not. My concern
is when a macro is involved, having the cell in Edit mode
messes up things including working in the VBE while
in cell edit.

Shows up more obviously if cell content is like
'AAA because then you will see the single quote
within the cell and the cursor after the last character.

Tools, Options, Edit, Edit Directly in a Cell
is invoked and it will stay that way.
Just want the macro to not leave it in Edit mode.

Test without and with a macro:
Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As

Boolean)
MsgBox "do nothing"
End Sub

The following will circumvent, but there must be a better way

Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As

Boolean)
MsgBox "do nothing"
Application.SendKeys "{Down}"
Application.SendKeys "{up}"
End Sub

And if "edit mode" is not the correct terminology
please correct. Might be obvious from the solution though.
---
TIA,
David McRitchie, Microsoft MVP - Excel [site changed Nov. 2001]
My Excel Pages: http://www.mvps.org/dmcritchie/excel/excel.htm
Search Page: http://www.mvps.org/dmcritchie/excel/search.htm





  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 691
Default Stop Cell Edit when DoubleClick

Thanks Norman,
Keep forgetting that, and the confusing part to me
is that it applies to disable the right-click menu
and to turning off cell edit.

But I guess they really are the same, because
that's why they are called context menus.

It will be added it at top to my event.htm so "I'll remember".
---
Thanks,
David McRitchie, Microsoft MVP - Excel [site changed Nov. 2001]
My Excel Pages: http://www.mvps.org/dmcritchie/excel/excel.htm
Search Page: http://www.mvps.org/dmcritchie/excel/search.htm

"Norman Jones" wrote ...
In the double-click Event macro set Cancel = True.

"David McRitchie" wrote ...
When I double-click on a cell it puts the cell into
"Edit mode". How do I turn this off.



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
From a Data Range DoubleClick on a cell to populate elsewhere KalliKay Excel Discussion (Misc queries) 1 May 6th 09 06:05 PM
doubleclick in cell to open link - how bjerre Excel Worksheet Functions 2 October 17th 07 04:01 PM
Force VB to doubleclick in a cell Brettjg Excel Discussion (Misc queries) 4 March 2nd 07 03:21 PM
Macro to stop Tools, Options, Edit sparx Excel Discussion (Misc queries) 0 May 25th 06 09:28 PM
Before DoubleClick John Pierce Excel Programming 1 October 28th 03 01:47 PM


All times are GMT +1. The time now is 10:27 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"