View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.misc
Rick Rothstein \(MVP - VB\)[_616_] Rick Rothstein \(MVP - VB\)[_616_] is offline
external usenet poster
 
Posts: 1
Default Is there a double click event for cell?

You would use the BeforeDoubleClick event of the worksheet and use the
Target argument (cell double clicked is passed into the event procedure via
this argument) to filter on the cell you are interested in.

Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, _
Cancel As Boolean)
If Target.Address = "$C$8" Then
'
' Cell C8 was double clicked
' Put your code for it here
'
End If
End Sub

Note: Double clicking a cell usually puts Excel into edit mode within that
cell. If you don't want that to happen, set the Cancel argument to True.

Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, _
Cancel As Boolean)
If Target.Address = "$C$8" Then
Cancel = True
'
' Cell C8 was double clicked
' Put your code for it here
'
End If
End Sub


Rick


"Ayo" wrote in message
...
I am looking for a function that would perform a set of actions when I
double
click a cell in a worksheet. I know there is something like this in
Access.