Double Click Formula Cells

J

JJ

When you double click on a cell and there is a formula in the cell then the
precendents are selected. Is there a way to turn this off or automatically
go back to the cell you were on without any change to the window and its
positioning. What is the VBA for this?

Thanks in advance
 
G

Gord Dibben

JJ

Tools>Options>Edit Check "edit directly in cell" and you won't go to
precedents.

Application.EditDirectlyInCell = True

Gord Dibben Excel MVP
 
E

Earl Kiosterud

JJ,

When you double-click a formula cell, it goes into Edit Mode -- you see the
formula right there in the cell. Those colored "selections" are there as an
editing tool. You can drag them about to change the formula references.
They're really not selections, and you can ignore them. Once you leave Edit
mode (press Enter), they disappear.

I don't know what you mean by "go back to the cell you were on." You're
still editing the cell you double-clicked.
 
B

Bernie Deitrick

JJ,

Copy the code below, right-click on the sheet tab, select "view Code" and
paste the code in the window that appears. This will stop that behavior for
the current sheet. You could also use the workbook level
Workbook_SheetBeforeDoubleClick event, and if you create application level
events then you could probably do it there as well.

HTH,
Bernie
MS Excel MVP

Private Sub Worksheet_BeforeDoubleClick( _
ByVal Target As Range, Cancel As Boolean)
Cancel = True
End Sub
 
J

JJ

Thanks

Bernie Deitrick said:
JJ,

Copy the code below, right-click on the sheet tab, select "view Code" and
paste the code in the window that appears. This will stop that behavior for
the current sheet. You could also use the workbook level
Workbook_SheetBeforeDoubleClick event, and if you create application level
events then you could probably do it there as well.

HTH,
Bernie
MS Excel MVP

Private Sub Worksheet_BeforeDoubleClick( _
ByVal Target As Range, Cancel As Boolean)
Cancel = True
End Sub
 
Top