Opv
07-14-2010, 08:46 AM
I have a simple BeforeDoubleClick script to automatically toggle the value of a cell when the user double clicks the cell. The script is working as desired, except that when I double click the cell, I am then in edit mode. I have to press ESC on the keyboard or manually click out of the cell to get out of edit mode.
Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean)
If ActiveCell.Column = 24 And ActiveCell.Row = 2 _
And ActiveCell.Value = "ToSale" Then
ActiveCell.Value = "Select"
Else: ActiveCell.Value = "ToSale"
Call eraseXs
End If
End Sub
Is there a way this script can be modified to force Excel out of edit mode whenever the target cell is doubleclicked?
Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean)
If ActiveCell.Column = 24 And ActiveCell.Row = 2 _
And ActiveCell.Value = "ToSale" Then
ActiveCell.Value = "Select"
Else: ActiveCell.Value = "ToSale"
Call eraseXs
End If
End Sub
Is there a way this script can be modified to force Excel out of edit mode whenever the target cell is doubleclicked?