View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Gary''s Student Gary''s Student is offline
external usenet poster
 
Posts: 11,058
Default Before Double Click

How about:

Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As
Boolean)
If Target.Column = 1 Then
Cancel = True
Call dble(Target.Value)
End If
End Sub

Where dble is in a standard module.
--
Gary''s Student


"DaveyJones" wrote:

Private Sub Worksheet_BeforeDoubleClick(ByVal _
Target As Range, Cancel As Boolean)
Dim a As String, b, c
Cancel = True 'Get out of edit mode
a = ActiveCell
b = ActiveCell.Address
c = Range(b).Column
If b < "1" Then Exit Sub
Call dble(a)
End Sub

I looked on http://www.mvps.org/dmcritchie/excel/event.htm#change for ideas
and I copied some code and edited it to the above. Basically, I want to
contents of the cell that was double clicked on to be taken to sub dble. BUt
this should only happen if the cell clicked on was in column A. You can see
my attempt at doing this. For some reason it does not work though. When I
double click nothin happens. But when I get rid of my code it works fine. Any
suggestions...


--
Dave