Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 4
Default How do I exit a cells edit mode?

If you select a cell and press F2, or double click it, the cell will go into
edit mode. I am using the following code to insert ticks and crosses in blank
cells:

Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As
Boolean)
If ActiveCell = "û" Or Len(ActiveCell) = 0 Then
ActiveCell.Font.Name = "Wingdings"
ActiveCell.Font.Size = "14"
ActiveCell.Font.ColorIndex = 50
ActiveCell = "ü"
Else
If ActiveCell = "ü" Then
ActiveCell.Font.Name = "Wingdings"
ActiveCell.Font.Size = "14"
ActiveCell.Font.Color = vbRed
ActiveCell = "û"
End If
End If
End Sub

After this code has run the cell goes into edit mode, and as the code runs
'BeforeDoubleClick' I can't get out of edit mode in the code. Any ideas?
--
Adam Thwaites
Access Database Designer

Manchester, UK
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 772
Default How do I exit a cells edit mode?

Through this in at the beginning of your code to stope editing in the cell
Application.EditDirectlyInCell = False
--
-John
Please rate when your question is answered to help us and others know what
is helpful.


"Adam Thwaites" wrote:

If you select a cell and press F2, or double click it, the cell will go into
edit mode. I am using the following code to insert ticks and crosses in blank
cells:

Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As
Boolean)
If ActiveCell = "û" Or Len(ActiveCell) = 0 Then
ActiveCell.Font.Name = "Wingdings"
ActiveCell.Font.Size = "14"
ActiveCell.Font.ColorIndex = 50
ActiveCell = "ü"
Else
If ActiveCell = "ü" Then
ActiveCell.Font.Name = "Wingdings"
ActiveCell.Font.Size = "14"
ActiveCell.Font.Color = vbRed
ActiveCell = "û"
End If
End If
End Sub

After this code has run the cell goes into edit mode, and as the code runs
'BeforeDoubleClick' I can't get out of edit mode in the code. Any ideas?
--
Adam Thwaites
Access Database Designer

Manchester, UK

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 22,906
Default How do I exit a cells edit mode?

Add the Cancel = True line as shown

Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As _
Boolean)
If ActiveCell = "û" Or Len(ActiveCell) = 0 Then
ActiveCell.Font.Name = "Wingdings"
ActiveCell.Font.Size = "14"
ActiveCell.Font.ColorIndex = 50
ActiveCell = "ü"
Else
If ActiveCell = "ü" Then
ActiveCell.Font.Name = "Wingdings"
ActiveCell.Font.Size = "14"
ActiveCell.Font.Color = vbRed
ActiveCell = "û"
End If
End If
Cancel = True 'add this line
End Sub


Gord Dibben MS Excel MVP

On Wed, 17 Oct 2007 09:47:01 -0700, Adam Thwaites
wrote:

If you select a cell and press F2, or double click it, the cell will go into
edit mode. I am using the following code to insert ticks and crosses in blank
cells:

Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As
Boolean)
If ActiveCell = "û" Or Len(ActiveCell) = 0 Then
ActiveCell.Font.Name = "Wingdings"
ActiveCell.Font.Size = "14"
ActiveCell.Font.ColorIndex = 50
ActiveCell = "ü"
Else
If ActiveCell = "ü" Then
ActiveCell.Font.Name = "Wingdings"
ActiveCell.Font.Size = "14"
ActiveCell.Font.Color = vbRed
ActiveCell = "û"
End If
End If
End Sub

After this code has run the cell goes into edit mode, and as the code runs
'BeforeDoubleClick' I can't get out of edit mode in the code. Any ideas?


  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 4,624
Default How do I exit a cells edit mode?

Insert

Cancel = True

after the

ActiveCell = ...

lines.

In article ,
Adam Thwaites wrote:

If you select a cell and press F2, or double click it, the cell will go into
edit mode. I am using the following code to insert ticks and crosses in blank
cells:

Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As
Boolean)
If ActiveCell = "û" Or Len(ActiveCell) = 0 Then
ActiveCell.Font.Name = "Wingdings"
ActiveCell.Font.Size = "14"
ActiveCell.Font.ColorIndex = 50
ActiveCell = "ü"
Else
If ActiveCell = "ü" Then
ActiveCell.Font.Name = "Wingdings"
ActiveCell.Font.Size = "14"
ActiveCell.Font.Color = vbRed
ActiveCell = "û"
End If
End If
End Sub

After this code has run the cell goes into edit mode, and as the code runs
'BeforeDoubleClick' I can't get out of edit mode in the code. Any ideas?

  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 4,624
Default How do I exit a cells edit mode?

Note that this will disable ALL double clicks, even if the active cell's
value is not "û","ü", or blank (which may be exactly what you want, but
isn't obvious from your code).

In article ,
Gord Dibben <gorddibbATshawDOTca wrote:

Add the Cancel = True line as shown

Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As _
Boolean)
If ActiveCell = "û" Or Len(ActiveCell) = 0 Then
ActiveCell.Font.Name = "Wingdings"
ActiveCell.Font.Size = "14"
ActiveCell.Font.ColorIndex = 50
ActiveCell = "ü"
Else
If ActiveCell = "ü" Then
ActiveCell.Font.Name = "Wingdings"
ActiveCell.Font.Size = "14"
ActiveCell.Font.Color = vbRed
ActiveCell = "û"
End If
End If
Cancel = True 'add this line
End Sub


Gord Dibben MS Excel MVP

On Wed, 17 Oct 2007 09:47:01 -0700, Adam Thwaites
wrote:

If you select a cell and press F2, or double click it, the cell will go into
edit mode. I am using the following code to insert ticks and crosses in
blank
cells:

Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As
Boolean)
If ActiveCell = "û" Or Len(ActiveCell) = 0 Then
ActiveCell.Font.Name = "Wingdings"
ActiveCell.Font.Size = "14"
ActiveCell.Font.ColorIndex = 50
ActiveCell = "ü"
Else
If ActiveCell = "ü" Then
ActiveCell.Font.Name = "Wingdings"
ActiveCell.Font.Size = "14"
ActiveCell.Font.Color = vbRed
ActiveCell = "û"
End If
End If
End Sub

After this code has run the cell goes into edit mode, and as the code runs
'BeforeDoubleClick' I can't get out of edit mode in the code. Any ideas?



  #6   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 22,906
Default How do I exit a cells edit mode?

Thanks John

Will have to study this some more<g

I see your second post and will look at that for pointers.


Gord

On Wed, 17 Oct 2007 11:31:45 -0600, JE McGimpsey wrote:

Note that this will disable ALL double clicks, even if the active cell's
value is not "û","ü", or blank (which may be exactly what you want, but
isn't obvious from your code).

In article ,
Gord Dibben <gorddibbATshawDOTca wrote:

Add the Cancel = True line as shown

Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As _
Boolean)
If ActiveCell = "û" Or Len(ActiveCell) = 0 Then
ActiveCell.Font.Name = "Wingdings"
ActiveCell.Font.Size = "14"
ActiveCell.Font.ColorIndex = 50
ActiveCell = "ü"
Else
If ActiveCell = "ü" Then
ActiveCell.Font.Name = "Wingdings"
ActiveCell.Font.Size = "14"
ActiveCell.Font.Color = vbRed
ActiveCell = "û"
End If
End If
Cancel = True 'add this line
End Sub


Gord Dibben MS Excel MVP

On Wed, 17 Oct 2007 09:47:01 -0700, Adam Thwaites
wrote:

If you select a cell and press F2, or double click it, the cell will go into
edit mode. I am using the following code to insert ticks and crosses in
blank
cells:

Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As
Boolean)
If ActiveCell = "û" Or Len(ActiveCell) = 0 Then
ActiveCell.Font.Name = "Wingdings"
ActiveCell.Font.Size = "14"
ActiveCell.Font.ColorIndex = 50
ActiveCell = "ü"
Else
If ActiveCell = "ü" Then
ActiveCell.Font.Name = "Wingdings"
ActiveCell.Font.Size = "14"
ActiveCell.Font.Color = vbRed
ActiveCell = "û"
End If
End If
End Sub

After this code has run the cell goes into edit mode, and as the code runs
'BeforeDoubleClick' I can't get out of edit mode in the code. Any ideas?


  #7   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 13
Default How do I exit a cells edit mode?

Hi. Is there any way to cancel Excel edit mode using COM interfaces
from outside?
I mean, can it be canceled from other application that gets pointer to
Excel IDispatch? Any ideas? Thanks.

On Oct 17, 7:31 pm, JE McGimpsey wrote:
Note that this will disable ALL double clicks, even if the active cell's
value is not "û","ü", or blank (which may be exactly what you want, but
isn't obvious from your code).

In article ,
Gord Dibben <gorddibbATshawDOTca wrote:

Add the Cancel = True line as shown


Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As _
Boolean)
If ActiveCell = "û" Or Len(ActiveCell) = 0 Then
ActiveCell.Font.Name = "Wingdings"
ActiveCell.Font.Size = "14"
ActiveCell.Font.ColorIndex = 50
ActiveCell = "ü"
Else
If ActiveCell = "ü" Then
ActiveCell.Font.Name = "Wingdings"
ActiveCell.Font.Size = "14"
ActiveCell.Font.Color = vbRed
ActiveCell = "û"
End If
End If
Cancel = True 'add this line
End Sub


Gord Dibben MSExcelMVP


On Wed, 17 Oct 2007 09:47:01 -0700, Adam Thwaites
wrote:


If you select a cell and press F2, or double click it, the cell will go into
editmode. I am using the following code to insert ticks and crosses in
blank
cells:


Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As
Boolean)
If ActiveCell = "û" Or Len(ActiveCell) = 0 Then
ActiveCell.Font.Name = "Wingdings"
ActiveCell.Font.Size = "14"
ActiveCell.Font.ColorIndex = 50
ActiveCell = "ü"
Else
If ActiveCell = "ü" Then
ActiveCell.Font.Name = "Wingdings"
ActiveCell.Font.Size = "14"
ActiveCell.Font.Color = vbRed
ActiveCell = "û"
End If
End If
End Sub


After this code has run the cell goes intoeditmode, and as the code runs
'BeforeDoubleClick' I can't get out ofeditmodein the code. Any ideas?



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
run procedure when exit design mode Wim SKW Excel Discussion (Misc queries) 1 July 11th 07 09:24 AM
Cells no longer highlighted in XL2003 edit mode? Zipdisk Excel Discussion (Misc queries) 2 September 26th 06 04:17 AM
I can't exit from Design mode anymore Ray Excel Discussion (Misc queries) 0 April 20th 06 02:31 PM
What is procedure to exit formula auditing mode? W8 Excel Discussion (Misc queries) 3 February 14th 05 09:05 PM
Combo Box goes to edit mode even if design mode is in OFF position Chas Excel Discussion (Misc queries) 0 January 7th 05 08:21 PM


All times are GMT +1. The time now is 08:46 PM.

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"