disable cursor when double click

S

sunilpatel

i have this code in sheet1

Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As
Boolean)
Application.EditDirectlyInCell = True
Range("A1").Activate
End Sub

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Range("A1").Select
End Sub

In range "A1" i have a word "dog"


hence when i single click any cell on sheet1 cell a1 is selected. This is
what i want. So if i want to change dog to cat i just type.

But if i double click a cell a cursor appears after the "g" in dog, hence i
have to use backspace to then enter "cat"

I need to prevent the cursor appearing in any instance, hence allowing me to
directly type over existing word

Please help
 
J

Jim Thomlinson

Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As
Boolean)
Application.EditDirectlyInCell = True
Range("A1").Activate
Cancel = true 'Cancel the default behaviour
End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top