View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Jim Thomlinson Jim Thomlinson is offline
external usenet poster
 
Posts: 5,939
Default disable cursor when double click

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
--
HTH...

Jim Thomlinson


"sunilpatel" wrote:

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