Bob
Thu Sep 07 12:39:44 CDT 2006
Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As
Boolean)
Const WS_RANGE As String = "H1:H10"
If Not Intersect(Target, Me.Range(WS_RANGE)) Is Nothing Then
MsgBox Target.Offset(0, -2).Value + Target.Offset(0, -1).Value
End If
ws_exit:
Application.EnableEvents = True
End Sub
'This is worksheet event code, which means that it needs to be
'placed in the appropriate worksheet code module, not a standard
'code module. To do this, right-click on the sheet tab, select
'the View Code option from the menu, and paste the code in.
This works on a double-click on any of H1:H10, and shows the sum in the
preceding two columns.
--
HTH
Bob Phillips
(replace somewhere in email address with gmail if mailing direct)
"sdebu_2000" <sdebu_2000.2drxme@NoSpamPleaze.com> wrote in message
news:sdebu_2000.2drxme@NoSpamPleaze.com...
>
> Hi all,
> can anybody help me ?
> I want a VBA code to run after double/single click on a cell of a
> worksheet.
> eg. after double/single click on a cell a msgbox will appear with the
> sum of two other cell values.Please help me how to write this VBA code
> in excell.
>
>
> --
> sdebu_2000
> ------------------------------------------------------------------------
> sdebu_2000's Profile:
http://www.officehelp.in/member.php?userid=4308
> View this thread:
http://www.officehelp.in/showthread.php?t=1192122
>
> Posted from -
http://www.officehelp.in
>